'string', 'name' => 'string', 'price' => 'float', 'cost' => 'float', 'notes' => 'string', 'active' => 'boolean', ]; /** * Validation rules * * @var array */ public static $rules = [ 'code' => 'required', 'name' => 'required', ]; /** * any foreign keys */ public function subfleets() { return $this->belongsToMany( 'App\Models\Subfleet', 'subfleet_fare' )->withPivot('price', 'cost', 'capacity'); } }