1
0
Fork 0
forked from mirror/pixelfed

Update PageController

This commit is contained in:
Daniel Supernault 2019-06-19 14:30:33 -06:00
parent a3be4cd697
commit ef3e30dbb8
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -50,4 +50,29 @@ class PageController extends Controller
$page->save(); $page->save();
return response()->json(['msg' => 200]); return response()->json(['msg' => 200]);
} }
public function generatePage(Request $request)
{
$this->validate($request, [
'page' => 'required|string|in:about,terms,privacy',
]);
$page = $request->input('page');
switch ($page) {
case 'about':
Page::firstOrCreate(['slug' => '/site/about']);
break;
case 'privacy':
Page::firstOrCreate(['slug' => '/site/privacy']);
break;
case 'terms':
Page::firstOrCreate(['slug' => '/site/terms']);
break;
}
return redirect(route('admin.settings.pages'));
}
} }