Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/Job/ResourceCreate.php
- This file was copied from src/app/Console/Commands/Job/UserUpdate.php.
<?php | <?php | ||||
namespace App\Console\Commands\Job; | namespace App\Console\Commands\Job; | ||||
use App\Console\Command; | use App\Console\Command; | ||||
use App\User; | |||||
class UserUpdate extends Command | class ResourceCreate extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'job:userupdate {user}'; | protected $signature = 'job:resourcecreate {resource}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = "Execute the UserUpdate job (again)."; | protected $description = "Execute the resource creation job (again)."; | ||||
/** | /** | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$user = $this->getUser($this->argument('user')); | $resource = $this->getResource($this->argument('resource')); | ||||
if (!$user) { | if (!$resource) { | ||||
return 1; | return 1; | ||||
} | } | ||||
$job = new \App\Jobs\User\UpdateJob($user->id); | $job = new \App\Jobs\Resource\CreateJob($resource->id); | ||||
$job->handle(); | $job->handle(); | ||||
} | } | ||||
} | } |