Nuevos cambios hechos de diseño

This commit is contained in:
ellecio2
2023-08-23 17:33:44 -04:00
parent 7a806f84ff
commit d2e9ba53ab
3485 changed files with 691106 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Http\Resources\V2;
use Illuminate\Http\Resources\Json\ResourceCollection;
class UserCollection extends ResourceCollection
{
public function toArray($request)
{
return [
'data' => $this->collection->map(function($data) {
return [
'id' => (integer) $data->id,
'name' => $data->name,
'type' => $data->user_type,
'email' => $data->email,
'avatar' => $data->avatar,
'avatar_original' => uploaded_asset($data->avatar_original),
'address' => $data->address,
'city' => $data->city,
'country' => $data->country,
'postal_code' => $data->postal_code,
'phone' => $data->phone
];
})
];
}
public function with($request)
{
return [
'success' => true,
'status' => 200
];
}
}