Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/PlanPackagesCommand.php
Show All 33 Lines | class PlanPackagesCommand extends Command | ||||
/** | /** | ||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$plans = Plan::get(); | $plans = Plan::all(); | ||||
foreach ($plans as $plan) { | foreach ($plans as $plan) { | ||||
$this->info(sprintf("Plan: %s", $plan->title)); | $this->info(sprintf("Plan: %s", $plan->title)); | ||||
$plan_costs = 0; | $plan_costs = 0; | ||||
foreach ($plan->packages()->get() as $package) { | foreach ($plan->packages()->get() as $package) { | ||||
$qtyMin = $package->pivot->qty_min; | $qtyMin = $package->pivot->qty_min; | ||||
Show All 38 Lines |