' ErrorException' with message非法偏移类型为isset或为空

时间:2016-02-15 18:22:22

标签: laravel laravel-5.2

我是Laravel的新手。我试图在我的视图中显示错误,但我收到错误:

  

ErrorException,带有消息' isset中的非法偏移类型或为空

这是我的错误逻辑:

@foreach(['success' => 'check', 'info' => 'exclamation-circle', 'warning' => 'warning', 'danger' => 'ban'] as $type => $icon )
    @if (Session::has($type))
        <div class="alert alert-{{ $type }} fade in">
            <a href="#" class="close" data-dismiss="alert"></a>
            <i class="fa fa-{{ $icon }}"></i> {{ Session::get( $type ) }}
        </div>
    @endif
@endforeach

@if (count($errors) > 0)
    @foreach ($errors->all() as $index => $message)
        <div class="alert alert-danger fade in">
            <a href="#" class="close" data-dismiss="alert">&times;</a>
            <i class="fa fa-times"></i>&nbsp; {{ $message }}
        </div>
    @endforeach
@endif

我做错了什么?

0 个答案:

没有答案