/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy(Article $article) { $deleteText = ''; if ($article->deleteImages()) { $deleteText = 'and successfully deleted the files!'; } else { $deleteText = 'and file deletion failed!'; } $article->tags()->detach(); $article->delete(); // redirect to the article index return Redirect('articles')->with('message', 'Article deleted, ' . $deleteText . ''); }