I have two tables in my laravel jetstream project.
Tables: Projets, teachers and students with relation HasMany, BelongTo. I tried to show projects tables with all students assigned to particular project just like this in image…
Student model:
public function project()
{
return $this->belongsTo(Project::class);
}
Project model:
public function students()
{
return $this->hasMany(Student::class);
}
I successfully get the number of students assigned to project, but how to show picture like in image above?
$project->students->count()
I am using laravel with livewire, and jetstream.. so user profile would be access like this:
<img src="{{ Auth::user()->profile_photo_url }}" alt="{{ Auth::user()->name }}" class="w-16 h-16 rounded-full mr-4">
Please any idea how to fix or do it? Thanks.