Hello @arqeco
For this I should start by the State and load the users for the states
Example:
// in your service/controller
$states = State::query()
->with('users')
->orderBy('name')
->get();
// in your blade
<ul>
@foreach ($states as $state)
<li>
{{$state->name}}
<ul>
@foreach($state->users as $user)
<li>{{$user->name}}</li>
@endforeach
</ul>
</li>
@endforeach
</ul>
This expect a state model that has a relation to the users.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community