1
0
Fork 0

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
1 changed files with 3 additions and 0 deletions

View File

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