public function artist_update($artist_id) { $data = Input::all(); $validator = Validator::make($data, Artist::rules()); if ($validator->passes()) { $artist = Artist::find($artist_id); if ($artist) { $artist->name = $data['name']; $artist->about = $data['about']; $artist->save(); return Redirect::route('music-artist')->with('message', 'Artist updated successfully')->with('type', 'success'); } else { return Redirect::route('music-artist')->with('message', 'The specified artist cannot be found')->with('type', 'danger'); } } else { return Redirect::route('music-artist')->withInputs()->withErrors($validator)->with('message', 'Invalid entries. Please try again later')->with('type', 'danger'); } }