content = $content; } /** * Method for changing page status * This method is called in static page overview from quick actions. It checks if status is valid, if page exists * and updates status. * * @param Content $page * @param $status * * @return \Illuminate\Http\RedirectResponse */ public function changeStatus(Content $page, $status) { Interaction::handle(ChangeStatus::class, ['status' => $status], $page); // redirect back to overview with info for user return redirect() ->route('content.overview') ->with('success', trans('admin/contents.statusChanged')); } /** * Delete page * * @param Content $page * * @return \Illuminate\Http\RedirectResponse */ public function delete(Content $page) { Interaction::handle(DeletePage::class, [], $page); // redirect back to overview with info for user return redirect() ->route('content.overview') ->with('success', trans('admin/contents.pageDeleted', [ 'name' => $page->title ])); } /** * Sets page as homepage * * @param Content $page * * @return \Illuminate\Http\RedirectResponse */ public function setHomepage(Content $page) { Interaction::handle(SetHomepage::class, [], $page); // redirect back to overview with info for user return redirect() ->back() ->with('success', trans('admin/contents.homepageSetup', [ 'name' => $page->title, 'url' => $page->url ])); } }