Viewing file: DailyUpdateCommand.php (1.04 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command; use App\Models\Order; use Carbon\Carbon; class DailyUpdateCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'daily:seed-restaurant';
/** * The console command description. * * @var string */ protected $description = 'Command description';
/** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); }
/** * Execute the console command. * * @return int */ public function handle() { if(env('APP_DEMO')){ Order::whereIn('id', [1, 2, 3])->update([ 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), ]); // $this->call(\Database\Seeders\OrderSeeder::class); $this->info('ran successfully.'); } } }
|