Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Undefined property: IlluminateDatabaseQueryBuilder::$name

use IlluminateHttpResourcesJsonJsonResource;

class Players extends JsonResource
{
    /**
     * Transform the resource collection into an array.
     *
     * @param  IlluminateHttpRequest  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'userId' => $this->sessionId,
            'userName' => $this->userName,
            'userVote' => $this->userVote
        ];
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Undefined
ADD COMMENT
Topic
Name
5+8 =