📜  laravel where 和 Blade - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:44.948000             🧑  作者: Mango

代码示例1
// NOTE: all project with open and processed that you have not submitted an offer yet.

// NOTE 1 (Controller): all projects with open and processed
$projects = Project::whereIn('status_id', [2,3])->get();

// NOTE 2 (Blade):
@if (count($project->projectOffers->where('teacher_id',auth()->user()->id)) == 0)
// Your code
@endif