Link Github :https://github.com/schmich/instascan/tree/master
Link Youtube : https://www.youtube.com/watch?v=joGdb4lzQzM

Langkah Awal:
Buat database di phpmyadmin

Contoh : db_laravel_qrscaner

Kemudian buat:
 
      - Tabel Siswa 



      - Tabel Absen

Laravel Kode:

View:
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>QR Scaner</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  </head>
  <body>

    <div class="container col-lg-4 py-5">
        {{-- Scanner --}}
        <div class="card bg-white shadow rounded-3 p-3 border-0">
            {{-- pesan --}}
            @if (@session()->has('gagal'))
            <p>Gagal</p>
            @endif
            @if (@session()->has('berhasil'))
                <p>Masuk</p>
            @endif

            <video id="preview"></video>
            {{-- form --}}
            <form action="{{ route('store') }}" method="POST" id="form">
                @csrf
                <input type="hidden" name="id_siswa" id="id_siswa">
            </form>   
        </div>
        {{-- Scanner --}}
        <div class="table-responsive mt-5">
            <table class="table table-bordered table-hover">
                <tr>
                    <th>Nama</th>
                    <th>Tanggal</th>
                </tr>
            </table>
        </div>
    </div> 

    <script type="text/javascript" src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"></script>
    
    <script type="text/javascript">
        let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
        scanner.addListener('scan', function (content) {
          console.log(content);
        });
        Instascan.Camera.getCameras().then(function (cameras) {
          if (cameras.length > 0) {
            scanner.start(cameras[0]);
          } else {
            console.error('No cameras found.');
          }
        }).catch(function (e) {
          console.error(e);
        });

        scanner.addListener('scan', function(c) {
            document.getElementById('id_siswa').value = c;
            document.getElementById('form').submit();
        });
    </script>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
  </body>
</html>

1. Route :
     
    Route::post('/store', [AbsenController::class, 'store'])->name('store');

2. Absensi 
 <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Absen extends Model
{
    use HasFactory;
    protected $guarded = ['id'];
}

3. AbsensiControler 

<?php
namespace App\Http\Controllers;
use App\Models\Absen;
use Illuminate\Http\Request;

class AbsenController extends Controller
{
    public function store(Request $request)
    {
        // Cek data
        $cek = Absen::where([
            'id_siswa' => $request->id_siswa,
            'tanggal'  => date('Y-m-d')
        ])->first();

        if($cek){
            return redirect('/')->with('gagal', 'Anda sudah Absen');
        }

        Absen::create([
            'id_siswa' => $request->id_siswa,
            'tanggal'  => date('Y-m-d')
        ]);
        return redirect('/')->with('berhasil', 'Silahkan masuk');
    }
}