当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::destroy方法代码示例

本文整理汇总了PHP中app\Page::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::destroy方法的具体用法?PHP Page::destroy怎么用?PHP Page::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Page的用法示例。


在下文中一共展示了Page::destroy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: destroy

 public function destroy(Page $page)
 {
     if (\Request::has('id')) {
         Page::destroy(\Request::input('id'));
         return ['result' => true];
     }
     $page->delete();
     return redirect('dash/page')->with('message', 'Page was delete success.');
 }
开发者ID:ravuthz,项目名称:cms-laravel5.1,代码行数:9,代码来源:PageController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     /* $page = Page::find($id);
             $page->delete();
     
             return Redirect::to('admin');*/
     if (Page::destroy($id)) {
         return Response::json(array('success' => true, 'type' => 'delete'));
     } else {
         return Response::json(array('success' => false, 'type' => 'delete'));
     }
 }
开发者ID:dmodaii,项目名称:laravel5.1-angular,代码行数:18,代码来源:PagesController.php

示例3: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Session::flash('flash_message', 'Stránka byla smazána.');
     return redirect()->route('pages.index');
 }
开发者ID:jZejda,项目名称:oplanManager,代码行数:12,代码来源:PagesController.php

示例4: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
 }
开发者ID:jmeyers44,项目名称:liftmetrix-project,代码行数:10,代码来源:PagesController.php

示例5: deleteForumTopicAction

 public function deleteForumTopicAction($page_id)
 {
     $page = Page::where('id', '=', $page_id)->first();
     if ($page->is_sheet) {
         $messages = ForumPageMessage::where('page_id', '=', $page->id)->get();
         foreach ($messages as $message) {
             ForumPageMessage::destroy($message->id);
         }
     } else {
         $child_pages = Page::where('parent_id', '=', $page->id)->get();
         foreach ($child_pages as $child_page) {
             $messages = ForumPageMessage::where('page_id', '=', $child_page->id);
             foreach ($messages as $message) {
                 ForumPageMessage::destroy($message->id);
             }
             Page::destroy($child_page->id);
         }
     }
     Page::destroy($page->id);
     return redirect('/admin/contents/forum/' . $page->parent_id);
 }
开发者ID:chelizminska,项目名称:laravel_new,代码行数:21,代码来源:BaseController.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect('/admin/pages')->with('status', 'Страница удалена!');
 }
开发者ID:AbuLoot,项目名称:unichina,代码行数:11,代码来源:AdminPagesController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $page = Page::destroy($id);
     flash()->success('Page Deleted');
     return redirect('pages');
 }
开发者ID:chrismoulins,项目名称:Laravel,代码行数:12,代码来源:PageController.php

示例8: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Session::flash('flash_message', 'Page deleted!');
     return redirect('page');
 }
开发者ID:AleksandrKovalev,项目名称:laravel_blog,代码行数:13,代码来源:PageController.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect('/admin/pages');
 }
开发者ID:hathway,项目名称:TUI_CMS_POC,代码行数:11,代码来源:PagesController.php

示例10: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     return redirect()->route('page.index');
 }
开发者ID:edrobotij,项目名称:portfolio,代码行数:11,代码来源:PageController.php

示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Page::destroy($id);
     Flash::success("Запись - {$id} удалена");
     return redirect(route('admin.pages.index'));
 }
开发者ID:jambik,项目名称:sellmecar,代码行数:12,代码来源:PagesController.php

示例12: delete

 public function delete(Request $request)
 {
     //locations to be deleted
     $data = [];
     //check for single delete
     if (isset($request->id)) {
         $data[] = $request->id;
     }
     //check for mass delete if no single delete
     if (empty($data)) {
         $data = $request->input('page_id');
     }
     //delete
     if (!empty($data)) {
         Page::destroy($data);
         //clear cache, set message, redirect to list
         Cache::flush();
         session()->flash('message', trans('admin_common.Page deleted'));
         return redirect(url('admin/page'));
     }
     //nothing for deletion set message and redirect
     session()->flash('message', trans('admin_common.Nothing for deletion'));
     return redirect(url('admin/page'));
 }
开发者ID:gdinko,项目名称:dclassifieds.laravel,代码行数:24,代码来源:PageController.php


注:本文中的app\Page::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。