'float', 'cost' => 'float', 'capacity' => 'integer', 'type' => 'integer', 'active' => 'boolean', ]; public static $rules = [ 'code' => 'required', 'name' => 'required', 'type' => 'required', ]; /** * any foreign keys */ public function subfleets() { return $this->belongsToMany(Subfleet::class, 'subfleet_fare') ->withPivot('price', 'cost', 'capacity'); } }