Laravel – Custom Intermediate Table Models – eager loading
Here is my current setup: <?php namespace AppModels; use Exception; use IlluminateDatabaseEloquentModel; use IlluminateDatabaseEloquentRelationsBelongsTo; use IlluminateDatabaseEloquentRelationsBelongsToMany; class Employee extends Model { protected $table = 'employees'; protected $fillable = [ 'first_name', 'last_name', 'gender', 'birthdate', 'nationality_id', 'company_id', ]; public function positions(): BelongsToMany…