public function newPivot(Model $parent, array $attributes, $table, $exists, $using = null) { if ($using) { return new $using($parent, $attributes, $table, $exists); } return new Pivot($parent, $attributes, $table, $exists); }
public function newPivot(Model $parent, array $attributes, $table, $exists) { if ($parent instanceof Order) { return new ProductPrice($parent, $attributes, $table, $exists); } return parent::newPivot($parent, $attributes, $table, $exists); }