Tell us more about the error message?
Also, have you checked that your query actually returns any data? Do you have the right combination of userEmployee and identities?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have this controller:
public function goal_review()
{
$userCompany = Auth::user()->company_id;
$userEmployee = Auth::user()->employee_id;
$identities = DB::table('appraisal_identity')->select('id')->where('company_id', $userCompany)->where('is_current', 1)->first();
$goals = AppraisalGoal::where('employee_id', $userEmployee)->where('appraisal_identity_id', $identities->id)->get();
return view('appraisal.appraisal_goals.goal_review')->with('goals', $goals);
}
route/web.php
Route::group(['prefix' => 'appraisal', 'as' => 'appraisal.', 'namespace' => 'Appraisal', 'middleware' => ['auth']], function () {
Route::get('appraisal_goals/goal_review', 'AppraisalGoalsController@goal_review')->name('appraisal_goals.goal_review');
});
When I tried to render it with:
<li class="nav-item">
<a href="{{ route("appraisal.appraisal_goals.goal_review") }}" class="nav-link {{ request()->is('appraisal.appraisal_goals') || request()->is('appraisal.appraisal_goals/*') ? 'active' : '' }}">
<i class="nav-icon fas fa-balance-scale"></i>
<p>
<span>Goals Review</span>
</p>
</a>
</li>
I got this error:
Page not found. No query results for model [App\Models\Appraisal\AppraisalGoal] goal_review
How do I resolve this?
Please or to participate in this conversation.