2022-11-18 12:39:03 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Page;
|
|
|
|
|
|
|
|
|
|
class PageController extends Controller
|
|
|
|
|
{
|
2022-12-23 17:24:09 +00:00
|
|
|
/**
|
|
|
|
|
* Page show
|
|
|
|
|
*
|
|
|
|
|
* @param string $slug
|
|
|
|
|
* @return \Illuminate\Contracts\View\View
|
|
|
|
|
*/
|
|
|
|
|
public function index(string $slug)
|
2022-11-18 15:35:39 +01:00
|
|
|
{
|
2022-11-18 12:39:03 +01:00
|
|
|
$page = Page::where('slug', $slug)->first();
|
2022-11-18 15:35:39 +01:00
|
|
|
if ($page == null) {
|
|
|
|
|
abort(404);
|
|
|
|
|
}
|
2022-11-18 12:39:03 +01:00
|
|
|
return view('pages.page', compact('page'));
|
|
|
|
|
}
|
|
|
|
|
}
|