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.
xshop/app/Http/Resources/AdvResource.php

29 lines
568 B
PHP

<?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,
];
}
}