Level 11
I stripped all the code out to just the following. Am still getting the above error.
public function store(Request $request)
{
$album = MusicAlbum::where(id => $request->get('album_id'))->first();
}
I get the following error in the dev console. I am not seeing where the issue is.
{message: "syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'", exception: "ParseError",…}
public function store(Request $request)
{
$customMessages = [
'mimes' => 'The :attribute must be an MP3 file.'
];
$this->validate($request, [
'title' => 'required',
'file' => 'max:20000|mp3_ogg_extension',
],$customMessages);
$album = MusicAlbum::where(id => $request->get('album_id')); -- ERROR HERE
if($album->user_id == \Auth::user()->id){
$music = new Mp3();
$music->title=$request['title'];
if($request->has('file')){
$s3 = \Storage::disk(config('filesystems.default'));
$path=$s3->put("/music_album_mp3s", request()->file, 'public');
$music->mp3=$path;
}
$music->music_album_id = $request['album_id'];
$music->save();
return $music;
}
}
Please or to participate in this conversation.