当前位置: 首页>>代码示例>>PHP>>正文


PHP Artisan::command方法代码示例

本文整理汇总了PHP中Artisan::command方法的典型用法代码示例。如果您正苦于以下问题:PHP Artisan::command方法的具体用法?PHP Artisan::command怎么用?PHP Artisan::command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Artisan的用法示例。


在下文中一共展示了Artisan::command方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     //  move the revision table
     if (!file_exists(database_path('migrations/2013_04_09_062329_create_revisions_table.php')) && ($fs = fopen(database_path('migrations/2013_04_09_062329_create_revisions_table.php'), 'x'))) {
         fwrite($fs, file_get_contents(base_path('vendor/venturecraft/revisionable/src/migrations/2013_04_09_062329_create_revisions_table.php')));
         fclose($fs);
     }
     //  make a notifications migration if not already created
     if (!\Illuminate\Support\Facades\Schema::hasTable('notifications')) {
         \Artisan::command('notifications:table');
     }
     $this->laravel->view->addNamespace('laraboard', substr(__DIR__, 0, -8) . 'migrations');
     $postsTable = 'posts';
     $subscriptionsTable = 'subscriptions';
     $alertsTable = 'alerts';
     $this->line('');
     $this->info("Tables: {$postsTable}, {$subscriptionsTable}, {$alertsTable}");
     $message = $this->generateMigrationMessage([$postsTable, $subscriptionsTable, $alertsTable]);
     $this->comment($message);
     $existingMigrations = $this->alreadyExistingMigrations();
     if ($existingMigrations) {
         $this->line('');
         $this->warn($this->getExistingMigrationsWarning($existingMigrations));
     }
     $this->line('');
     if (!$this->confirm("Proceed with the migration creation?", "yes")) {
         return;
     }
     $this->line('');
     $this->info("Creating migration...");
     if ($this->createMigration()) {
         $this->info("Migration successfully created!");
     } else {
         $this->error("Couldn't create migration.\n" . "Check the write permissions within the database/migrations directory.");
     }
     $this->line('');
 }
开发者ID:christhompsontldr,项目名称:laraboard,代码行数:42,代码来源:MigrationsCommand.php

示例2: function

<?php

use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
});
开发者ID:nerea91,项目名称:laravel,代码行数:16,代码来源:console.php

示例3: function

<?php

use Illuminate\Foundation\Inspiring;
/*
|--------------------------------------------------------------------------
| Console Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of your Closure based console
| commands. Each Closure is bound to a command instance allowing a
| simple approach to interacting with each command's IO methods.
|
*/
Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->describe('Display an inspiring quote');
开发者ID:Dreamerpro,项目名称:thinkmerit.api,代码行数:16,代码来源:console.php


注:本文中的Artisan::command方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。