public function destroy(Author $author) { $deleted = $author->delete(); session()->flash('flash_message', 'Author was removed with success'); if (Request::wantsJson()) { return (string) $deleted; } return redirect('authors'); }