So my route is defined as:
Route::get('dashboard/upgrade/invoice/{code}',[PackageController::class,'invoice'])->name('user.invoice');
The visited url is:
https://examplewebsite.com/dashboard/upgrade/invoice/3SInyM0RwGkKz2vSYsqLxlfsL
now this url sometimes open without any error. other times, it returns 500 SERVER ERROR
When I checked my laravel.log to see why, I see:
production.ERROR: Index invalid or out of range {"view":{"view":"/home/xx/xx/resources/views/dashboard/upgrade/invoice.blade.php","data":[]},"userId":xx,"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Index invalid or out of range at /home/fewflyok/xxx/vendor/bacon/bacon-qr-code/src/Encoder/MaskUtil.php:134)
on the blade template, I have the qrcode line called with:
{!! QrCode::color(34, 27, 114)->size(150)->generate($invoice->address ) !!}
Now I want I am not using the bacon-qr-code on this particular blade. I have a different qrCode package (SimpleSoftwareIO) which I already set up on my config/app.
I then discover that the stacktrace traces to the qrcode I am using. So here is an extended log:
[stacktrace]
#0 xx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(197): BaconQrCode\\Encoder\\MaskUtil::applyMaskPenaltyRule3()
#1 xxx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(244): BaconQrCode\\Encoder\\Encoder::calculateMaskPenalty()
#2 xxx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(135): BaconQrCode\\Encoder\\Encoder::chooseMaskPattern()
#3 xxx/vendor/bacon/bacon-qr-code/src/Writer.php(54): BaconQrCode\\Encoder\\Encoder::encode()
.
.
#4 xxx/vendor/simplesoftwareio/simple-qrcode/src/Generator.php(171): BaconQrCode\\Writer->writeString()
#5 xxx/resources/views/dashboard/upgrade/invoice.blade.php(31): SimpleSoftwareIO\\QrCode\\Generator->generate()
.
.
#6 xxx/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('/home/fewk/...')
#7 xxx/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#8 xxx/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#9 xx/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(61): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#10 xxx/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()