Php 当传递值时,它表示未定义的变量

Php 当传递值时,它表示未定义的变量,php,laravel,laravel-5.3,Php,Laravel,Laravel 5.3,这是我在布局中的@include调用的视图。master: <li id="alert_notificatoin_bar" class="dropdown"> <a data-toggle="dropdown" class="dropdown-toggle" href=" {{url('/admin/notification')}}">

这是我在
布局中的@include调用的视图。master

      <li id="alert_notificatoin_bar" class="dropdown">
                    <a data-toggle="dropdown" class="dropdown-toggle" href="   
                         {{url('/admin/notification')}}">
                        <i class="icon-bell-l"></i>


                        <span class="badge bg-important">{{ $users}}</span>


                    </a>
                    <ul class="dropdown-menu extended notification">
                        <div class="notify-arrow notify-arrow-blue"></div>
                        <li>
                            <p class="blue">You have  notifications</p>
                        </li>


                        <li>
                            <a href="{{url('/admin/notificationshow')}}">
                             @foreach($users1 as $u)
                                <span class="label label-success"><i class="icon_like"></i></span> 
                                {{$u->name}}
                                <span class="small italic pull-right"> {{$u->created_at}}</span>
                                 @endforeach;
                            </a>
                        </li>   

                        <li>
                            <a href="#">See all notifications</a>
                        </li>

                    </ul>
                </li>
下面是我的另一个关于获取错误通知显示的视图

        <div class="row">
         <div class="col-lg-12">


           <div> 
                    @foreach($users1 as $u)
                   <span class="label label-success"><i class="icon_like"></i>
                   {{$u->name}}</span>
                   <span class="small italic pull-right"><label> <h5>Requested at</h5></label>{{$u-   
                    >created_at}}</span>
                   <label><h5>Waiting for Approval</h5></label>
                   @endforeach
                   <form class="login-form" role="form" method="POST" action="{{ url('/admin/')    
                 }}">
                        {{ csrf_field() }} 

            <button class="btn btn-primary btn-lg btn-block" type="submit">Approve</button>
                </div>
            </form>

@foreach($users1作为$u)
{{$u->name}
在{{$u-
>在}创建
等待批准
@endforeach
{{csrf_field()}}
批准

为什么它给我错误请帮助我检查使用dd($user1);它给出了值,但为什么在其他视图notificationshow中传递值时出错这是一种代码整洁,特别是缩进,可以帮助您识别代码中的错误的情况。查看上面提供的代码,有不匹配的
标记,以及可能导致错误的奇怪位置的换行符。

在这种情况下,代码整洁,特别是缩进,可以帮助您识别代码中的错误。查看上面提供的代码,有不匹配的
标记,以及可能导致错误的奇怪位置的换行符。

您得到的错误是什么?未定义变量。。。。我在使用@include('header.blade.php')的地方使用了@foreach。但是当我试图访问layout.master时,它抛出了一个错误Unfine variable你得到了什么错误?Unfine variable。。。。我使用@include('header.blade.php'),其中使用@foreach
        <div class="row">
         <div class="col-lg-12">


           <div> 
                    @foreach($users1 as $u)
                   <span class="label label-success"><i class="icon_like"></i>
                   {{$u->name}}</span>
                   <span class="small italic pull-right"><label> <h5>Requested at</h5></label>{{$u-   
                    >created_at}}</span>
                   <label><h5>Waiting for Approval</h5></label>
                   @endforeach
                   <form class="login-form" role="form" method="POST" action="{{ url('/admin/')    
                 }}">
                        {{ csrf_field() }} 

            <button class="btn btn-primary btn-lg btn-block" type="submit">Approve</button>
                </div>
            </form>