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 $id * @param $status * * @return \Illuminate\Http\RedirectResponse */ public function changeStatus($id, $status) { $page = $this->content->getOne($id); 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 $id * * @return \Illuminate\Http\RedirectResponse */ public function delete($id) { $page = $this->content->getOne($id); 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 $id * * @return \Illuminate\Http\RedirectResponse */ public function setHomepage($id) { $page = $this->content->getOne($id); 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 ])); } }