- add position
This commit is contained in:
@@ -17,7 +17,8 @@ class CreateCV extends Command
|
||||
{phone : Phone number - with spaces}
|
||||
{location?* : List of locations}
|
||||
{--mission= : Description of mission}
|
||||
{--rodo= : Description of rodo}';
|
||||
{--rodo= : Description of rodo}
|
||||
{--position= : Set position value}';
|
||||
|
||||
protected $description = 'Create CV';
|
||||
|
||||
@@ -29,6 +30,7 @@ class CreateCV extends Command
|
||||
$locations = $this->argument('location');
|
||||
$mission = $this->option('mission');
|
||||
$rodo = $this->option('rodo');
|
||||
$position = $this->option('position');
|
||||
|
||||
CV::query()
|
||||
->create([
|
||||
@@ -39,6 +41,7 @@ class CreateCV extends Command
|
||||
'locations' => $locations,
|
||||
'mission' => $mission,
|
||||
'rodo' => $rodo,
|
||||
'position' => $position,
|
||||
]);
|
||||
|
||||
$this->info('Created!');
|
||||
|
@@ -17,7 +17,8 @@ class UpdateCV extends Command
|
||||
{--add-location=* : Add locations}
|
||||
{--remove-location=* : Remove lcoations}
|
||||
{--mission= : Set new text value}
|
||||
{--rodo= : Set new text value}';
|
||||
{--rodo= : Set new text value}
|
||||
{--position= : Set position value}';
|
||||
|
||||
protected $description = 'Update CV element';
|
||||
|
||||
@@ -66,6 +67,9 @@ class UpdateCV extends Command
|
||||
if ($rodo = $this->option('rodo')) {
|
||||
$cv->rodo = $rodo === 'null' ? null : $rodo;
|
||||
}
|
||||
if ($position = $this->option('position')) {
|
||||
$cv->position = $position === 'null' ? null : $position;
|
||||
}
|
||||
|
||||
$cv->save();
|
||||
|
||||
|
@@ -27,6 +27,10 @@ class CVResource extends JsonResource
|
||||
!is_null($this->rodo),
|
||||
$this->rodo
|
||||
),
|
||||
'position' => $this->when(
|
||||
!is_null($this->position),
|
||||
$this->position
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property array $locations
|
||||
* @property string|null $mission
|
||||
* @property string|null $rodo
|
||||
* @property string|null $position
|
||||
* @property int $views
|
||||
*/
|
||||
class CV extends Model
|
||||
|
Reference in New Issue
Block a user