mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
35 lines
1.0 KiB
PHP
35 lines
1.0 KiB
PHP
<?php
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ShareResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'data' => [
|
|
'id' => (string) $this->id,
|
|
'type' => 'shares',
|
|
'attributes' => [
|
|
'permission' => $this->permission,
|
|
'is_protected' => $this->is_protected,
|
|
'item_id' => $this->item_id,
|
|
'expire_in' => (int) $this->expire_in,
|
|
'token' => $this->token,
|
|
'link' => $this->link,
|
|
'type' => $this->type,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
],
|
|
],
|
|
];
|
|
}
|
|
}
|