Controller.php
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public $settings;
public function __construct(Request $req)
{
$this->middleware(function ($request, $next) use ($req)
{
$settings = Settings::all();
foreach($settings AS $id => $item)
{
$this->settings[$item["param"]] = $item["value"];
View::share ( $item["param"], $item["value"] );
}
return $next($request);
});
}
}
Использование
Контроллер:
$this->settings["title"];
В шаблоне:
{{ $title }}