28 lines
659 B
PHP
28 lines
659 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\Import\Resources;
|
||
|
|
|
||
|
|
use App\Modules\Import\DTOs\ImportResult;
|
||
|
|
use Illuminate\Http\Request;
|
||
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @property ImportResult $resource
|
||
|
|
*/
|
||
|
|
class ImportResultResource extends JsonResource
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @return array<string, mixed>
|
||
|
|
*/
|
||
|
|
public function toArray(Request $request): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'total' => $this->resource->total,
|
||
|
|
'created' => $this->resource->created,
|
||
|
|
'updated' => $this->resource->updated,
|
||
|
|
'skipped' => $this->resource->skipped,
|
||
|
|
'errors' => $this->resource->errors,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|