布局问题,请参阅附件

时间:2019-07-16 18:21:13

标签: laravel

@section('content')
    <!-- Jumbotron -->
    <div class="jumbotron">
        <h1>{{$company->name}}</h1>
        <p class="lead">{{$company->description}}</p>
      <!--  <p><a class="btn btn-lg btn-success" href="#" role="button">Get started today</a></p>  -->
    </div>

    <!-- Example row of columns -->
    <div class="row">
        @foreach($company->projects as project)
            <div class="col-lg-4">
                <h2>{{ $project->name }}</h2>
                <p class="text-danger">{{ $project->description  }}</p>
                <p><a class="btn btn-primary" href="/projects/{{$project->id}}" role="button">View details »</a></p>
            </div>
        @endforeach
    </div>
@endsection
  

语法错误,意外的')',预期为'['(视图:C:\ Users \ system Admin \ Desktop \ social-login \ resources \ views \ companies \ show.blade.php)

1 个答案:

答案 0 :(得分:0)

检查foreach语句。您错过了“ $”。应该是:

...
@foreach($company->projects as $project)
...