24 lines
543 B
PHP
24 lines
543 B
PHP
<?php
|
|
|
|
namespace App\Api\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ChannelIndexResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'title' => $this->title,
|
|
'img' => $this->storage_id ? $this->storage ? 'http://www.bohaimingpin.com'.$this->storage->path : '' : '',
|
|
];
|
|
}
|
|
}
|