final things applied and ready for version 1
This commit is contained in:
parent
41488de7e6
commit
56af829037
|
|
@ -36,26 +36,23 @@ public function submit(Request $request){
|
|||
$attender = Attender::create($data);
|
||||
$attender->events()->attach($request->event_id);
|
||||
|
||||
$attendance = DB::table('event_attenders')
|
||||
->where('event_id', $request->event_id)
|
||||
->where('attender_id', $attender->id)
|
||||
->first();
|
||||
if($attender){
|
||||
$attendance = DB::table('event_attenders')
|
||||
->where('event_id', $request->event_id)
|
||||
->where('attender_id', $attender->id)
|
||||
->first();
|
||||
|
||||
$file_name = uniqid() . '.png';
|
||||
$qrCodePath = public_path('qr/' . $file_name);
|
||||
QrCode::format('png')->size(512)->margin(10)->generate($attendance->id, $qrCodePath);
|
||||
$file_name = uniqid() . '.png';
|
||||
$qrCodePath = public_path('qr/' . $file_name);
|
||||
QrCode::format('png')->size(512)->margin(10)->generate($attendance->id, $qrCodePath);
|
||||
|
||||
$imagedata = file_get_contents($qrCodePath);
|
||||
$base64 = base64_encode($imagedata);
|
||||
|
||||
Mail::send('emails.qr', ['base64' => $base64, 'attender' => $attender, 'file_name' => $file_name], function (Message $message) use ($attender, $file_name, $base64) {
|
||||
$message->to($attender->email)->subject($attender->name . " " . $attender->surname);
|
||||
// $message->embedData(base64_decode($base64), $file_name);
|
||||
|
||||
// $pngFile = new File($qrCodePath);
|
||||
// $message->attach($pngFile, ['as' => 'qr_code2.png', 'mime' => 'image/png']);
|
||||
});
|
||||
$imagedata = file_get_contents($qrCodePath);
|
||||
$base64 = base64_encode($imagedata);
|
||||
|
||||
Mail::send('emails.qr', ['base64' => $base64, 'attender' => $attender, 'file_name' => $file_name], function (Message $message) use ($attender, $file_name, $base64) {
|
||||
$message->to($attender->email)->subject($attender->name . " " . $attender->surname);
|
||||
});
|
||||
}
|
||||
return view('success');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@
|
|||
<div class="flex px-6 text-gray-600">
|
||||
<div class="flex-shrink-0 h-16 w-32">
|
||||
<h4 class="text-xs">Duration</h4>
|
||||
<h1 class="font-semibold text-blue-600 text-xl">{{ $event->duration }}</h1>
|
||||
<h1 class="font-semibold text-blue-600 text-xl text-left">{{ $event->duration }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="flex-shrink-0 h-16 w-32">
|
||||
<h4 class="text-xs">Starts on</h4>
|
||||
<h1 class="font-semibold text-blue-600 text-xl">{{ Carbon\Carbon::parse($event->is_active)->format('d M') }}</h1>
|
||||
<h1 class="font-semibold text-blue-600 text-xl text-left">{{ Carbon\Carbon::parse($event->is_active)->format('d M') }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue