25 lines
556 B
PHP
25 lines
556 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Admin;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class PermissionResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'name' => $this->name,
|
|
'label' => $this->label,
|
|
'created_at' => verta($this->created_at)->format('%d %B %Y %H:%M:%S'),
|
|
];
|
|
}
|
|
}
|