Fixed bug where PDF ticket generation would fail when no logo was passed (closes #97)

This commit is contained in:
Dave Earley 2016-05-12 13:33:34 +01:00
parent f689ff3b1e
commit d256fecaf8
3 changed files with 12 additions and 12 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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