2020-02-25 14:14:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use Backpack\PageManager\app\Models\Page;
|
2020-02-25 16:03:49 +00:00
|
|
|
use Illuminate\Support\Facades\Config;
|
2020-02-25 14:14:19 +00:00
|
|
|
class PageController extends Controller
|
|
|
|
|
{
|
|
|
|
|
public function index($slug, $subs = null)
|
|
|
|
|
{
|
2020-03-01 16:56:49 +00:00
|
|
|
$page = Page::findBySlug($slug.'_'.Config::get('app.locale'));
|
2020-02-25 14:14:19 +00:00
|
|
|
|
|
|
|
|
if (!$page)
|
|
|
|
|
{
|
|
|
|
|
abort(404, 'Please go back to our <a href="'.url('').'">homepage</a>.');
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-25 15:02:10 +00:00
|
|
|
$data['title'] = $page->title;
|
2020-02-25 15:13:34 +00:00
|
|
|
$data['page'] = $page->content;
|
2020-02-25 14:14:19 +00:00
|
|
|
|
2020-03-03 11:26:47 +00:00
|
|
|
return $this->render('Pages.AboutPage', $data);
|
2020-02-25 14:14:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|