本文整理汇总了PHP中app\Article::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Article::delete方法的具体用法?PHP Article::delete怎么用?PHP Article::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Article
的用法示例。
在下文中一共展示了Article::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy(Article $article)
{
$article->delete();
Cache::forget('article:' . $article->id);
Cache::forget('article:all');
return redirect('/');
}
示例2: destroy
public function destroy(Article $article)
{
// $id から $article へ変更
$article->delete();
\Flash::warning('記事を削除しました。');
return redirect()->route('articles.index');
}
示例3: destroy
public function destroy(Article $article)
{
// $article = Article::findOrFail($id);
$article->delete();
\Session::flash('flash_message', '記事を削除しました。');
// return redirect('articles');
return redirect()->route('articles.index');
}
示例4: destroy
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');
}
示例5: destroy
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', 'Новость успешно удалена.');
}
示例6: destroy
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.');
}
示例7: destroy
/**
* 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');
}
示例8: destroy
/**
* 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');
}
示例9: destroy
/**
* Remove the specified resource from storage.
*
* @param $id
* @return Response
*/
public function destroy(Article $article)
{
$article->delete();
}
示例10: destroy
/**
* 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');
}
示例11: destroy
public function destroy(Article $article)
{
$article->delete();
session()->flash('flash_message', 'Article was removed with success');
}
示例12: destroy
/**
* 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();
}
}
示例13: destroy
/**
* 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'));
}
示例14: 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']);
}
示例15: destroy
public function destroy(Article $article)
{
$article->delete();
\Flash::success('記事を削除しました。');
return redirect()->route('articles.index');
}