39 lines
1,014 B
PHP
39 lines
1,014 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Http\Resources\ShowInstancesResource;
|
|
use App\Models\ShowInstances\ShowInstances;
|
|
use App\Traits\ScheduleTrait;
|
|
use Illuminate\Console\Command;
|
|
|
|
class createShowSchedule extends Command
|
|
{
|
|
use ScheduleTrait;
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'app:create-show-schedule';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = "Get's the shows instances to be played in the next hour";
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
// TODO Get all show instances to be played in the next hour
|
|
$showInstances = ShowInstances::all();
|
|
// TODO For each show instance run createTheSchedule->manageTheSchedule(showInstance)
|
|
foreach ($showInstances as $showInstance) {
|
|
$this->createOneShowInstanceSchedule($showInstance);
|
|
}
|
|
}
|
|
}
|