Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm having an issue with a Laravel blade view that is not rendering properly and keeps loading forever. I have a route that is supposed to display a profile page for a user, and it was working fine with pure HTML. However, when I tried to use the blade view, the page keeps loading and does not display anything.

Here's my code for the route:

PHP
Route::get('/profile/{family_id}', [UserProfileController::class, 'showProfile'])->name('profile');


And here's my code for the blade view (profile.blade.php):

PHP
@extends('dashboard-layout')
@section('title','Dashboard')
@section('content')
<div class="content-body">
    <div class="row">
        <div class="col-lg-12">
            <div class="profile">
                <div class="profile-head">
                    <div class="profile-info">
                        <div class="row justify-content-center">
                            <div class="col-xl-8">
                                <div class="row">
                                    <div class="col-xl-4 col-sm-4 border-right-1 prf-col">
                                        <div class="profile-name">
                                            <h4 class="text-primary">Name: {{$clients -> headofhousehold_firstname}}  {{$clients -> headofhousehold_lastname}}</h4>
                                            <p>Address: {{$clients -> address}}</p>
                                        </div>
                                    </div>
                                    <div class="col-xl-4 col-sm-4 border-right-1 prf-col">
                                        <div class="profile-email">
                                            <h4 class="text-muted">  <p>Family ID : {{$clients -> id}} </p></h4>
                                            <p>Email</p>
                                        </div>
                                    </div>
                                   
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection


What I have tried:

I've tried removing the @section('title','Dashboard') and @section('content') directives, and the page loads properly. However, I need those sections for my layout.

I'm not sure what's causing the issue, but I suspect it may have something to do with the route or the blade view. Any help or suggestions would be greatly appreciated. Thanks in advance!
Posted
Updated 15-May-23 17:37pm
v2
Comments
Member 15627495 10-Apr-23 5:26am    
you had already 'isolate' the faulty lines.

your php server have a 'max time loading value' before break out.
and your code going in a loop, a cycling query.

check all the 'instructions chain' when the loop happens.

are the datas provided as well as needed ?
are you on a good use about laravel ?

if you make 'cycling calls' by laravel, you'll find it quickly.

read again your code, the bug is in.
sean871 10-Apr-23 18:22pm    
could you explain more
sean871 10-Apr-23 18:52pm    
is this approoach better


$client_info = Family::with(['pendingcases', 'demographics', 'requestOrder'])->find($family_id);

return view('profile', ['clients' => $client_info]);

1 solution

the issue was with my route

i fix the route

Route::get('profile', [UserProfileController::class, 'showProfile'])->name('profile'); 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900