app/Http/Resources/Users.php
/**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
Transform the resource collection into an array.
@param  \Illuminate\Http\Request  $request
@return array
Transform the resource collection into an array . @param \ Illuminate \ Http \ Request $request @return array
public function toArray($request)
    {
        return [
            'id' => $this->id,
            'name' => $this->name,
            'sirname' => $this->sirname,
            'email' => $this->email,
            'businesses' => BusinessResource::collection($this->businesses),
            'created_at' => $this->created_at,
            'updated_at' => $this->updated_at,
        ];
    }
public function toArray ( $ request ) { return [ 'id' => $ this -> id , 'name' => $ this -> name , 'sirname' => $ this -> sirname , 'email' => $ this -> email , 'businesses' => BusinessResource :: collection ( $ this -> businesses ) , 'created_at' => $ this -> created_at , 'updated_at' => $ this -> updated_at , ] ; }
Transform the resource collection into an array.
Transform the resource collection into an array .