本文整理汇总了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.');
}
示例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'));
}
}
示例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');
}
示例4: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Page::destroy($id);
}
示例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);
}
示例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', 'Страница удалена!');
}
示例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');
}
示例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');
}
示例9: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Page::destroy($id);
return redirect('/admin/pages');
}
示例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');
}
示例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'));
}
示例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'));
}