public function run() { $driver = Driver::firstOrCreate(['name' => 'U.S. Postal Service', 'type' => 'shipping', 'class' => 'Bedard\\USPS\\Classes\\USPS', 'is_configurable' => true, 'is_default' => false]); $logo = new File(); $logo->fromFile(plugins_path('bedard/usps/assets/images/usps.png')); $logo->save(); $driver->image()->add($logo); }
/** * If no results are returned from USPS, defer to the basic shipping table * * @return array */ protected function deferToShippingTable() { $table = Driver::isShipping()->where('class', 'Bedard\\Shop\\Drivers\\Shipping\\BasicTable')->first(); if (!$table) { return []; } $driver = $table->getClass(); $driver->setCart($this->cart); return $driver->getRates(); }