remove compose file to another repo
This commit is contained in:
33
app/Http/Resources/Admin/UserResource.php
Normal file
33
app/Http/Resources/Admin/UserResource.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class UserResource extends JsonResource
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'full_name' => $this->full_name,
|
||||
'username' => $this->username,
|
||||
'gender' => $this->gender,
|
||||
'email' => $this->email,
|
||||
'phone_number' => $this->phone_number,
|
||||
'avatar' => $this->avatar,
|
||||
'national_id' => $this->national_id,
|
||||
'position' => $this->position,
|
||||
'province_id' => $this->province_id,
|
||||
'province_name' => $this->province_name,
|
||||
'role' => $this->getRoleNames()->first(),
|
||||
'permissions' => $this->getAllPermissions()->pluck('name'),
|
||||
'telephone_id' => $this->telephone_id
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user