'string', 'name' => 'string', 'full_name' => 'string', 'registration' => 'string', 'active' => 'boolean', ]; /** * Validation rules * * @var array */ public static $rules = [ 'icao' => 'required|max:4', 'name' => 'required', 'full_name' => 'required', 'registration' => 'required', 'active' => 'default:1', ]; /** * 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; } }