Exemplo n.º 1
0
 public function destroy(Article $article)
 {
     $article->delete();
     Cache::forget('article:' . $article->id);
     Cache::forget('article:all');
     return redirect('/');
 }
 public function destroy(Article $article)
 {
     // $id から $article へ変更
     $article->delete();
     \Flash::warning('記事を削除しました。');
     return redirect()->route('articles.index');
 }
Exemplo n.º 3
0
 public function destroy(Article $article)
 {
     // $article = Article::findOrFail($id);
     $article->delete();
     \Session::flash('flash_message', '記事を削除しました。');
     // return redirect('articles');
     return redirect()->route('articles.index');
 }
 public function destroy(Article $article)
 {
     $deleted = $article->delete();
     session()->flash('flash_message', 'Article was removed with success');
     if (Request::wantsJson()) {
         return (string) $deleted;
     }
     return redirect('articles');
 }
 public function destroy(Article $article)
 {
     if ($article->image) {
         $imageDir = base_path() . config('app.uploads_articles_path') . '/' . $article->id;
         if (is_dir($imageDir)) {
             system("rm -rf " . escapeshellarg($imageDir));
         }
     }
     $article->delete();
     return redirect('/admin/article')->with('flash_success', 'Новость успешно удалена.');
 }
 public function destroy(Article $article)
 {
     /*
               $article = Article::findOrFail ( $id );
               $article->delete ();
               Session::flash ( 'flash_message', 'Article successfully deleted!' );
               return redirect ()->route ( 'articles' );
     */
     $article->delete();
     return Redirect::route('articles.index')->with('message', 'Article deleted.');
 }
Exemplo n.º 7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Article $article
  *
  * @internal param int $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     return redirect()->route('admin.articles.index');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param Article $article
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function destroy(Article $article)
 {
     $article->delete();
     Flash::success('Content deleted!');
     return redirect('admin/article');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
 }
Exemplo n.º 10
0
 /**
  * Remove the specified resource from storage.
  *
  * @param $id
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     flash()->warning('Artikel telah dihapus!');
     return redirect('dashboard/articles');
 }
Exemplo n.º 11
0
 public function destroy(Article $article)
 {
     $article->delete();
     session()->flash('flash_message', 'Article was removed with success');
 }
Exemplo n.º 12
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Request $request
  * @param Article $news
  * @return \Illuminate\Http\Response
  * @throws \Exception
  */
 public function destroy(Request $request, Article $news)
 {
     if ($request->ajax()) {
         $news->delete();
     }
 }
Exemplo n.º 13
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  ArticleRequest   $request
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     return Redirect::back()->with('flash_message', Lang::get('system.destroy'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  Article $article
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete();
     Flash::success('Your article was removed with success');
     return $this->respondTo(['html' => redirect('articles', 303), 'default' => 'Your article was removed with success']);
 }
 public function destroy(Article $article)
 {
     $article->delete();
     \Flash::success('記事を削除しました。');
     return redirect()->route('articles.index');
 }
Exemplo n.º 16
0
 public function destroy(Article $article)
 {
     $article->delete();
     \Flash::success('Your article has been Deleted');
     return redirect()->route('admin.articles.index');
 }
Exemplo n.º 17
0
 public function adminDelete(User $user, Article $article)
 {
     $article->delete();
     return redirect()->back();
 }
Exemplo n.º 18
0
 /**
  * Xóa một bài viết chỉ ra bởi Id
  *
  * @param  Article  $article
  * @return Response
  */
 public function destroy(Article $article)
 {
     \File::delete(public_path(config("image.paths") . 'articles/large' . $article->image));
     \File::delete(public_path(config("image.paths") . 'articles/medium' . $article->image));
     \File::delete(public_path(config("image.paths") . 'articles/small' . $article->image));
     $article->delete();
     return redirect('admin/article')->with('flash_message', config('blog.message.deleted'));
 }
 public function delete(Article $article)
 {
     //dd($article);
     $article->delete();
     flash()->overlay('Your Article has been removed!', 'Good Job');
     return redirect("myArticles");
     //return ('not available yet');
 }
Exemplo n.º 20
0
 public function destroy(Article $article)
 {
     $article->delete();
     return redirect('articles')->withMessage('Article Deleted');
 }
Exemplo n.º 21
0
 /**
  * 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 . '');
 }
 /**
  * Remove the specified article from storage.
  *
  * @param  Article  $article
  * @return Response
  */
 public function destroy(Article $article)
 {
     $article->delete() ? Flash::success(trans('admin.delete.success')) : Flash::error(trans('admin.delete.fail'));
     return redirect(route('admin.article.index'));
 }
Exemplo n.º 23
0
 public function destroy(Article $article)
 {
     $article->delete();
     return redirect('articles')->with(['flash_message' => 'Article successfully deleted!']);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request, Article $article)
 {
     $article->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($article);
     }
     return redirect('articles');
 }
Exemplo n.º 25
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Article $article
  * @return \Illuminate\Http\Response
  */
 public function destroy(Article $article)
 {
     $article->tags()->sync([]);
     $article->files()->sync([]);
     $article->delete();
     session()->flash('flash_message', 'Se ha eliminado tu artículo');
     return redirect('admin/articles');
 }
Exemplo n.º 26
0
 public function destroy(Article $article)
 {
     $article->delete();
     return redirect('articles');
 }
Exemplo n.º 27
0
 /**
  * Remove the specified resource from storage.
  *
  * @param Request $request
  * @param Article $article
  */
 public function destroy(Request $request, Article $article)
 {
     if ($request->ajax()) {
         $article->delete();
     }
 }