/**
  * The construct of invoice pdf factory
  */
 public function __construct(EloquentOrderRepository $order, $translation)
 {
     //init the parent construct
     parent::__construct();
     $this->translation = $translation;
     $this->order = $order;
     // invoice pdf path.
     $this->invoicePdfFilePath = \Config::get('pdf.invoices') . 'invoice-' . $order->id . '.pdf';
     $this->invoicePdfUrlPath = \Config::get('pdf.invoices') . 'invoice-' . $order->id . '.pdf';
     // template files.
     $this->driverLogoCircleCover = public_path(\Config::get('images.invoices.template') . 'driver_logo_bg.png');
     $this->paxifiLogoFilePath = public_path(\Config::get('images.invoices.template') . $this->paxifiLogoName);
     $this->paxifiLogoUrlPath = url(\Config::get('images.invoices.template') . $this->paxifiLogoName, $this->secure);
     $this->defaultDriverLogoFilePath = url(\Config::get('images.invoices.template') . $this->defaultDriverLogoName, $this->secure);
     $this->defaultDriverLogoUrlPath = url(\Config::get('images.invoices.template') . $this->defaultDriverLogoName, $this->secure);
     $this->setDriver($this->getOrderDriver());
 }
示例#2
0
 /**
  * Route to generate driver logo
  *
  * @param $driver
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function logo($driver = null)
 {
     try {
         if (is_null($driver)) {
             $driver = $this->getAuthenticatedDriver();
         }
         $factory = new DriverLogoFactory();
         $factory->setDriver($driver);
         $response = $factory->buildDriverLogo();
         return $this->setStatusCode(200)->respond($response);
     } catch (\RuntimeException $e) {
         return $this->setStatusCode(404)->respondWithError($e->getMessage());
     } catch (\Exception $e) {
         return $this->setStatusCode(500)->respondWithError($e->getMessage());
     }
 }
示例#3
0
 /**
  * @internal param \Paxifi\Sticker\Repository\Factory\EloquentDriverRepository $driver
  * @param FlysystemManager $flysystem
  */
 public function __construct(FlysystemManager $flysystem)
 {
     parent::__construct();
     $this->flysystem = $flysystem;
     $this->stickerDir = \Config::get('images.stickers.img');
     $this->stickerTemplateDir = \Config::get('images.stickers.template');
     $this->stickerPdfDir = \Config::get('pdf.stickers');
     $this->stickerTemplateName = \Config::get('stickers.template.name');
     $this->setDefaultFontOptions();
     $this->sticker = $this->getStickerInterventionCanvas();
 }