'string', 'name' => 'string', 'registration' => 'string', 'active' => 'boolean', ]; /** * Validation rules * * @var array */ public static $rules = [ 'icao' => 'required|max:5', 'name' => 'required', 'active' => '', ]; /** * foreign key */ public function class() { return $this->belongsTo( 'App\Models\AircraftClass', 'aircraft_class_id' ); } public function fares() { $r = $this->belongsToMany( 'App\Models\Fare', 'aircraft_fare' )->withPivot('price', 'cost', 'capacity'); return $r; } }