Use event image if present
This commit is contained in:
parent
5365b1172e
commit
dca10200f4
|
|
@ -49,9 +49,15 @@ class MyBaseController extends Controller
|
|||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$image_path = $event->organiser->full_logo_path;
|
||||
if ($event->images->first() != null) {
|
||||
$image_path = $event->images()->first()->image_path;
|
||||
}
|
||||
|
||||
return array_merge([
|
||||
'event' => $event,
|
||||
'questions' => $event->questions()->get(),
|
||||
'image_path' => $image_path,
|
||||
], $additional_data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,12 +60,17 @@ class GenerateTicket extends Job implements ShouldQueue
|
|||
}
|
||||
$attendees = $query->get();
|
||||
|
||||
$image_path = $event->organiser->full_logo_path;
|
||||
if ($event->images->first() != null) {
|
||||
$image_path = $event->images()->first()->image_path;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $event,
|
||||
'attendees' => $attendees,
|
||||
'css' => file_get_contents(public_path('assets/stylesheet/ticket.css')),
|
||||
'image' => base64_encode(file_get_contents(public_path($event->organiser->full_logo_path))),
|
||||
'image' => base64_encode(file_get_contents(public_path($image_path))),
|
||||
];
|
||||
|
||||
PDF::setOutputMode('F'); // force to file
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</style>
|
||||
<div class="ticket">
|
||||
<div class="logo">
|
||||
{!! HTML::image(asset($event->organiser->full_logo_path)) !!}
|
||||
{!! HTML::image(asset($image_path)) !!}
|
||||
</div>
|
||||
|
||||
<div class="event_details">
|
||||
|
|
@ -39,4 +39,4 @@
|
|||
<div class="barcode">
|
||||
{!! DNS2D::getBarcodeSVG('hello', "QRCODE", 6, 6) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue