- add CV management
This commit is contained in:
35
app/Console/Commands/ListCV.php
Normal file
35
app/Console/Commands/ListCV.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Http\Resources\CVResource;
|
||||
use App\Models\CV;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ListCV extends Command
|
||||
{
|
||||
protected $signature = 'cv:list';
|
||||
|
||||
protected $description = 'List of CV';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$cvList = CV::all();
|
||||
|
||||
/** @var CV $cv */
|
||||
foreach ($cvList as $cv) {
|
||||
$resource = new CVResource($cv);
|
||||
$this->line('ID: '. $resource->id);
|
||||
$this->line('Token: '. $resource->token);
|
||||
$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('');
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user