name = $name; $this->label = $label; $this->cost = Money::inDefaultCurrency($cost); } public function available() { if ($this->name !== 'free_shipping') { return true; } return $this->freeShippingMethodIsAvailable(); } private function freeShippingMethodIsAvailable() { $minimumAmount = Money::inDefaultCurrency(setting('free_shipping_min_amount')); return Cart::subTotal()->greaterThanOrEqual($minimumAmount); } }