mercredi 5 août 2020

Route is redirecting to wrong page


I'm working on Laravel 5 and I've set up the routes for all the pages. I have a dashboard that has certain icons which when clicked redirects to different pages. Now, this particular icon "Total Applications" is when clicked doesn't redirect to the page associated with it, i.e., total.blade.php but instead redirects to another page candidate.blade.php.
I'm new to Laravel. Can someone please help me out with this? I want that when I click the "Total Applications" page it should redirect to the page designated for it.
I'm sharing the codes below :-

dashboard.blade.php File :-
<div class="col-md-4">
    <div class="single-dashboard-link card card-default p-3 text-center" onclick="location.href=''">
        <i class="fa fa-file-text font30"></i>
        <h6>
         Total
        </h6>
        <p>
        Applications
        </p>
    </div>
</div>

Route file containing routes for both the pages:-

Route::get('/total-applications', 'Frontend\EmployersController@totalApplications')->name('employers.total');
Route::get('/{status}', 'Frontend\EmployersController@candidatesDisplay')->name('employers.candidate');

My controller containing the logic for Total Applications page:-

public function totalApplications() {
        if (!Auth::check()) {
            session()->flash('error', 'Sorry !! You are not an authenticated Employer !!');
            return back();
        }
        $user = Auth::user();
        $user_id = $user->id;
        $applicant = JobActivity::where('user_id',$user_id)->get();
        return view('frontend.pages.employers.total', compact('user', 'applicant'));
}

I hope this will help you understand my query. If you need anything else please let me know.
Thank you in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire