专注于schoolname专栏,我想要的是,我只能显示具有相同列名的所有值,例如,我只想显示与dlsu@edu.org相关的所有作业。 / p>
dlsu@edu.org也是ValueError: operands could not be broadcast together with shapes (.,.) (.,.)
的价值,
我有一个刀片,它显示所有工作, 控制器:
Auth::user()->name
刀片:
public function index()
{
$jobs = job::all();
return view('home',compact('jobs'));
}
我想显示由同一个人<div class='col-lg-8 col-lg-offset-2'>
<center><h1>Jobs</h1></center>
<ul class="list-group">
@foreach ($jobs as $job)
<li class="list-group-item d-flex justify-content-between align-items-center">
<a href="{{'/home/'.$job->id}}">
<b>{{$job->jobposition}}</b></a>
<span class="pull-right">{{$job->created_at->diffForHumans()}}</span>
<p>{{$job->jobdesc}}</p>
</li>
@endforeach
</ul>
</div>
我是新手,我知道这很容易,所以请原谅我,谢谢你回答
答案 0 :(得分:2)
$jobs = job::where('schoolname', Auth::user()->name)->all();