本文整理汇总了PHP中app\Article::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Article::destroy方法的具体用法?PHP Article::destroy怎么用?PHP Article::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Article
的用法示例。
在下文中一共展示了Article::destroy方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$article = Article::findOrFail($id);
if (Gate::denies('article_authorize', $article)) {
return "authorize fails";
}
Article::destroy($id);
return redirect('/admin/articles');
}
示例2: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
Article::destroy($id);
return redirect('/admin/articles');
}
示例3: destroy
public function destroy(Request $request)
{
$id = $request->get('id');
Article::destroy($id);
// return Redirect::back();
}
示例4: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Article::destroy($id);
return redirect('/article/')->with('flash_message', 'Article successfully deleted.');
}
示例5: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
Article::destroy($id);
return redirect()->action('Goenitz\\ArticleController@index');
}
示例6: destroy
public function destroy($id)
{
Article::destroy($id);
return redirect('article');
}
示例7: destroy
/**
* article destroy.
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
// Log::info('Showing user profile for user: '.$id);
return response()->json(Article::destroy($id));
}
示例8: deleteArticle
public function deleteArticle($category, $article)
{
$category = Category::all()->where('slug', strtolower($category))->first();
Article::destroy(Article::all()->where('slug', strtolower($article))->first()->id);
return redirect('/article/' . $category->slug)->with('message', 'Article supprimé avec succès.');
}
示例9: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy(Request $request)
{
Article::destroy($request->input('ids'));
return response()->json(['success' => true, 'message' => 'You did it!']);
}
示例10: destroy
public function destroy($id)
{
$article = Article::destroy($id);
return view('admin.article.index')->withArticles(Article::all());
}
示例11: destroy
public function destroy($photo)
{
$article = \App\Article::where('photo', $photo)->firstOrFail();
//权限
$this->authorOrAdminPermissioinRequire($article->user_id);
//delete photo
File::delete(base_path() . '/public/images/catalog/' . $article->photo . $article->type);
if ($article->type = '_long.jpg') {
File::delete(base_path() . '/public/images/catalog/' . $article->photo . '.jpg');
}
\App\Article::destroy($article->id);
return redirect('articles');
}
示例12: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$article = Article::destroy($id);
flash()->success('Article Archived');
return redirect('articles');
}
示例13: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
if (Article::destroy($id)) {
return Response::json(['msg' => 'Article deleted']);
} else {
return Response::json(['error' => 'Records not found'], 404);
}
}