add role permission logic
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Roles;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class PermissionResource extends JsonResource
|
||||
{
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
'id' => (int) ($this->id ?? $this['id'] ?? 0),
|
||||
'name' => (string) ($this->name ?? $this['name'] ?? ''),
|
||||
'description' => $this->description ?? $this['description'] ?? null,
|
||||
'created_at' => $this->created_at ?? $this['created_at'] ?? null,
|
||||
'updated_at' => $this->updated_at ?? $this['updated_at'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user