From d256fecaf8b8a2ce942b0cb5ab59cb32865ff9b6 Mon Sep 17 00:00:00 2001 From: Dave Earley Date: Thu, 12 May 2016 13:33:34 +0100 Subject: [PATCH] Fixed bug where PDF ticket generation would fail when no logo was passed (closes #97) --- app/Commands/SendAttendeeTicketCommand.php | 2 +- app/Models/Order.php | 20 ++++++++++---------- config/attendize.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Commands/SendAttendeeTicketCommand.php b/app/Commands/SendAttendeeTicketCommand.php index d8c24747..f57b3d70 100644 --- a/app/Commands/SendAttendeeTicketCommand.php +++ b/app/Commands/SendAttendeeTicketCommand.php @@ -62,7 +62,7 @@ class SendAttendeeTicketCommand extends Command implements ShouldQueue, SelfHand 'tickets' => $this->attendee->event->tickets, 'attendees' => [$this->attendee], 'css' => file_get_contents(public_path('assets/stylesheet/ticket.css')), - 'image' => base64_encode(file_get_contents(public_path($this->attendee->event->organiser->logo_path))), + 'image' => base64_encode(file_get_contents(public_path($this->attendee->event->organiser->full_logo_path))), ]; $pdf_file_name = $this->ticketOrder->order_reference.'-'.$this->attendee->id; diff --git a/app/Models/Order.php b/app/Models/Order.php index b25e6699..8ec91554 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -17,8 +17,8 @@ class Order extends MyBaseModel */ public $rules = [ 'order_first_name' => ['required'], - 'order_last_name' => ['required'], - 'order_email' => ['required', 'email'], + 'order_last_name' => ['required'], + 'order_email' => ['required', 'email'], ]; /** @@ -28,8 +28,8 @@ class Order extends MyBaseModel */ public $messages = [ 'order_first_name.required' => 'Please enter a valid first name', - 'order_last_name.required' => 'Please enter a valid last name', - 'order_email.email' => 'Please enter a valid email', + 'order_last_name.required' => 'Please enter a valid last name', + 'order_email.email' => 'Please enter a valid email', ]; /** @@ -98,7 +98,7 @@ class Order extends MyBaseModel return $this->belongsTo('\App\Models\OrderStatus'); } - + /** * Get the organizer fee of the order. * @@ -139,12 +139,12 @@ class Order extends MyBaseModel public function generatePdfTickets() { $data = [ - 'order' => $this, - 'event' => $this->event, - 'tickets' => $this->event->tickets, + 'order' => $this, + 'event' => $this->event, + 'tickets' => $this->event->tickets, 'attendees' => $this->attendees, - 'css' => file_get_contents(public_path('assets/stylesheet/ticket.css')), - 'image' => base64_encode(file_get_contents(public_path($this->event->organiser->logo_path))), + 'css' => file_get_contents(public_path('assets/stylesheet/ticket.css')), + 'image' => base64_encode(file_get_contents(public_path($this->event->organiser->full_logo_path))), ]; $pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')) . '/' . $this->order_reference; diff --git a/config/attendize.php b/config/attendize.php index 5b58b930..5b02e665 100644 --- a/config/attendize.php +++ b/config/attendize.php @@ -25,7 +25,7 @@ return [ 'event_pdf_tickets_path' => 'user_content/pdf_tickets', 'event_bg_images' => 'assets/images/public/EventPage/backgrounds', - 'fallback_organiser_logo_url' => '/assets/images/logo-100x100-lightBg.png', + 'fallback_organiser_logo_url' => '/assets/images/logo-dark.png', 'cdn_url' => '', 'checkout_timeout_after' => env('CHECKOUT_TIMEOUT_AFTER', 30), #minutes