mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
35 lines
577 B
PHP
35 lines
577 B
PHP
<?php
|
|
|
|
namespace App\Transformers;
|
|
|
|
use App\Models\File;
|
|
use League\Fractal\TransformerAbstract;
|
|
|
|
class FileTransformer extends TransformerAbstract
|
|
{
|
|
|
|
/**
|
|
* AA Array of possible includes for file model
|
|
* @var array
|
|
*/
|
|
protected array $availableIncludes = [
|
|
|
|
];
|
|
|
|
/**
|
|
* Transform File
|
|
* @param File $file
|
|
* @return array
|
|
*/
|
|
public function transform(File $file): array
|
|
{
|
|
|
|
return [
|
|
'id' => $file->id,
|
|
'file' => $file->file,
|
|
'type' => (int)$file->file_type,
|
|
];
|
|
|
|
}
|
|
}
|