15 lines
397 B
PHP
15 lines
397 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\CmsPage;
|
|
|
|
final class CmsPageController extends Controller
|
|
{
|
|
public function show(string $slug)
|
|
{
|
|
$page = CmsPage::where('slug', $slug)->where('is_published', true)->where(fn ($q) => $q->whereNull('published_at')->orWhere('published_at', '<=', now()))->firstOrFail();
|
|
return view('cms.show', compact('page'));
|
|
}
|
|
}
|