public function index() { $projects = Project::whereHas('status', function ($q) { $q->where('key', '=', 'published'); })->paginate(12); return view('users.project.main', ['projects' => $projects]); }