app/Resource/EntityResource.php
/**
     * Transform the resource into an array.
     *
     * @param  Request  $request
     * @return array
     */
Transform the resource into an array.
@param  Request  $request
@return array
Transform the resource into an array . @param Request $request @return array
public function toArray($request)
    {
        return [
            'id' => $this->getKey(),
            'title' => $this->entity
        ];
    }
public function toArray ( $ request ) { return [ 'id' => $ this -> getKey ( ) , 'title' => $ this -> entity ] ; }
Transform the resource into an array.
Transform the resource into an array .