- append more informations from api
This commit is contained in:
@@ -27,6 +27,8 @@ class CVInfo extends Command
|
||||
$this->line('Phone: '. $cv->formattedPhoneNumber .', '. $cv->PhoneNumber);
|
||||
$this->line('Locations: '. implode(' / ', $cv->locations));
|
||||
$this->line('Views: '. $cv->views);
|
||||
$this->line('Mission: '. (is_null($mission = $cv->mission) ? 'domyślne' : $mission));
|
||||
$this->line('Rodo: '. (is_null($rodo = $cv->rodo) ? 'domyślne' : $rodo));
|
||||
$this->line('');
|
||||
|
||||
$this->line('Showed list:');
|
||||
|
@@ -15,7 +15,9 @@ class CreateCV extends Command
|
||||
{recipient : Company}
|
||||
{email : E-mail address}
|
||||
{phone : Phone number - with spaces}
|
||||
{location?* : List of locations}';
|
||||
{location?* : List of locations}
|
||||
{--mission= : Description of mission}
|
||||
{--rodo= : Description of rodo}';
|
||||
|
||||
protected $description = 'Create CV';
|
||||
|
||||
@@ -25,6 +27,8 @@ class CreateCV extends Command
|
||||
$email = $this->argument('email');
|
||||
$phone = $this->argument('phone');
|
||||
$locations = $this->argument('location');
|
||||
$mission = $this->option('mission');
|
||||
$rodo = $this->option('rodo');
|
||||
|
||||
CV::query()
|
||||
->create([
|
||||
@@ -33,6 +37,8 @@ class CreateCV extends Command
|
||||
'email' => $email,
|
||||
'phone_number' => $phone,
|
||||
'locations' => $locations,
|
||||
'mission' => $mission,
|
||||
'rodo' => $rodo,
|
||||
]);
|
||||
|
||||
$this->info('Created!');
|
||||
|
@@ -26,7 +26,7 @@ class ListCV extends Command
|
||||
$this->line('Company: '. $resource->recipient);
|
||||
$this->line('Phone: '. $resource->formattedPhoneNumber .', '. $resource->PhoneNumber);
|
||||
$this->line('Locations: '. implode(' / ', $resource->locations));
|
||||
$this->line('Views: '. $resource->views);
|
||||
$this->line('Rodo: '. $resource->rodo);
|
||||
$this->line('');
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,9 @@ class UpdateCV extends Command
|
||||
{--phone= : Phone number}
|
||||
{--begin-location : Add begin}
|
||||
{--add-location=* : Add locations}
|
||||
{--remove-location=* : Remove lcoations}';
|
||||
{--remove-location=* : Remove lcoations}
|
||||
{--mission= : Set new text value}
|
||||
{--rodo= : Set new text value}';
|
||||
|
||||
protected $description = 'Update CV element';
|
||||
|
||||
@@ -58,6 +60,13 @@ class UpdateCV extends Command
|
||||
$cv->locations = $locations;
|
||||
}
|
||||
|
||||
if ($mission = $this->option('mission')) {
|
||||
$cv->mission = $mission === 'null' ? null : $mission;
|
||||
}
|
||||
if ($rodo = $this->option('rodo')) {
|
||||
$cv->rodo = $rodo === 'null' ? null : $rodo;
|
||||
}
|
||||
|
||||
$cv->save();
|
||||
|
||||
$this->info('Updated!');
|
||||
|
Reference in New Issue
Block a user