mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
568 B
PHTML
29 lines
568 B
PHTML
5 months ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Resources;
|
||
|
|
||
|
use App\Models\Adv;
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
||
|
class AdvResource extends JsonResource
|
||
|
{
|
||
|
/**
|
||
|
* Transform the resource into an array.
|
||
|
*
|
||
|
* @return array<string, mixed>
|
||
|
*/
|
||
|
public function toArray(Request $request): array
|
||
|
{
|
||
|
/**
|
||
|
* @var $this Adv
|
||
|
*/
|
||
|
return [
|
||
|
'id' => $this->id,
|
||
|
'image' => $this->imgUrl,
|
||
|
'title' => $this->title,
|
||
|
'link' => $this->link,
|
||
|
];
|
||
|
}
|
||
|
}
|