app/Http/Resources/SoundResource.php
/**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
Transform the resource into an array.
Transform the resource into an array .
public function toArray($request)
    {
        return [
            'id' => $this->id,
            'title' => $this->title,
            'description' => $this->description,
            'categories' => $this->Categories,
            'is_approved' => $this->is_approved,
            'url' => $this->getFirstMediaUrl('sound'),
            'user' => new UserResource($this->user),
        ];
    }
public function toArray ( $ request ) { return [ 'id' => $ this -> id , 'title' => $ this -> title , 'description' => $ this -> description , 'categories' => $ this -> Categories , 'is_approved' => $ this -> is_approved , 'url' => $ this -> getFirstMediaUrl ( 'sound' ) , 'user' => new UserResource ( $ this -> user ) , ] ; }
Transform the resource into an array.
Transform the resource into an array .