Changeset View
Changeset View
Standalone View
Standalone View
src/app/Plan.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | class Plan extends Model | ||||
]; | ]; | ||||
/** @var array Translatable properties */ | /** @var array Translatable properties */ | ||||
public $translatable = [ | public $translatable = [ | ||||
'name', | 'name', | ||||
'description', | 'description', | ||||
]; | ]; | ||||
/** | |||||
* The list price for this package at the minimum configuration. | |||||
* | |||||
* @return int The costs in cents. | |||||
*/ | |||||
public function cost() | public function cost() | ||||
{ | { | ||||
$costs = 0; | $costs = 0; | ||||
foreach ($this->packages as $package) { | foreach ($this->packages as $package) { | ||||
$costs += $package->pivot->cost(); | $costs += $package->pivot->cost(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |