Actualizacion de Diseño Logins y Parte de Registro Negocios
This commit is contained in:
38
desarrollo/app/Http/Resources/V2/ShopCollection.php
Normal file
38
desarrollo/app/Http/Resources/V2/ShopCollection.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\V2;
|
||||
|
||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||
|
||||
class ShopCollection extends ResourceCollection
|
||||
{
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'data' => $this->collection->map(function($data) {
|
||||
return [
|
||||
'id' => $data->id,
|
||||
'name' => $data->name,
|
||||
'logo' => uploaded_asset($data->logo),
|
||||
'rating' => $data->rating,
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
public function with($request)
|
||||
{
|
||||
return [
|
||||
'success' => true,
|
||||
'status' => 200
|
||||
];
|
||||
}
|
||||
|
||||
protected function convertPhotos($data){
|
||||
$result = array();
|
||||
foreach ($data as $key => $item) {
|
||||
array_push($result, uploaded_asset($item));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user