<?php

namespace App\Http\Controllers\Site;

use App\Model\Article;
use Illuminate\Http\Request;

class PageController extends BaseController
{


    public function index($page)
    {
        view()->share('current_section', $page);

        return view()->first([
            "site/pages/{$page}",
            "errors.404"
        ]);

        $article = Article::where('slug', $page)->first();

//        view()->share('current_section', 'about');

        return view()->first([
            "site/pages/" . config('app.locale') . "/{$page}",
            "site/pages/{$page}",
            "errors.404"
        ], compact('article'));
    }


}
