mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-19 00:22:15 +00:00
append subscription to the UserResource.php
This commit is contained in:
36
src/App/Users/Resources/SettingsResource.php
Normal file
36
src/App/Users/Resources/SettingsResource.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace App\Users\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class SettingsResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'data' => [
|
||||
'id' => $this->id,
|
||||
'type' => 'settings',
|
||||
'attributes' => [
|
||||
'avatar' => $this->avatar,
|
||||
'name' => $this->name,
|
||||
'address' => $this->address,
|
||||
'state' => $this->state,
|
||||
'city' => $this->city,
|
||||
'postal_code' => $this->postal_code,
|
||||
'country' => $this->country,
|
||||
'phone_number' => $this->phone_number,
|
||||
'timezone' => $this->timezone,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user