Laravel join query with conditions
I’m still not completely sure about your table relationships but from my guess, I came up with the following solution, first create the relationships using Eloquent models: User Model (for usres table): namespace App; use App\Course; use Illuminate\Notifications\Notifiable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Notifiable; public function courses() { return $this->hasMany(Course::class); … Read more