设置全局变量
view()->share('request_uri', $request->getRequestUri());
View::share 的简易用法.
开启 app/Providers/AppServiceProvider.php
public function boot()
{
view()->share('copyright', '这是版权宣告.');
}
开启随便一个xxx.blade.php
{{$copyright}}
设置全局变量
view()->share('request_uri', $request->getRequestUri());
View::share 的简易用法.
开启 app/Providers/AppServiceProvider.php
public function boot()
{
view()->share('copyright', '这是版权宣告.');
}
开启随便一个xxx.blade.php
{{$copyright}}