First Commit

This commit is contained in:
Muhammad Herdy Iskandar
2024-07-27 00:18:34 +07:00
commit a099b28858
168 changed files with 17696 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
class QrGeneratorController extends Controller
{
public function student($value)
{
// Path ke file logo di storage
$file_path = 'logo/santulitam-logo-qr.png';
// Dapatkan path lengkap ke file logo
$path_logo = storage_path(assets($file_path));
// Decode value dari URL
$value = urldecode($value);
// Generate QR code dengan logo yang di-merge
$generate = QrCode::format('png')
->merge($path_logo, 0.2, true)
->size(800)
->margin(1)
->generate($value);
// Kembalikan QR code sebagai response gambar PNG
return response($generate)->header('Content-Type', 'image/png');
}
}