Update PageController

This commit is contained in:
Daniel Supernault 2019-06-19 21:06:10 -06:00
parent e3cfd8170f
commit 7ade78b4ee
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -38,6 +38,9 @@ class PageController extends Controller
'page' => 'required|string'
]);
$slug = urldecode($request->page);
if(in_array($slug, array_keys($this->cacheKeys())) == false) {
return redirect(route('admin.settings.pages'));
}
$page = Page::firstOrCreate(['slug' => $slug]);
return view('admin.pages.edit', compact('page'));
}