前台模板layout.blade.php页面部分代码:
<nav>{{ $message }}</nav>
<div class="container"> @yield('content') </div>
<footer></footer>
其余页面继承该页面。
nav中的message数据该如何从后台传递过来?是在每个内容页面的controller里都传递一次吗?这样觉得很麻烦 ;另外一个问题,如何在AppServiceProvider的boot()方法中使用Auth::user()->id在各种方式获取当前登录用户的id?