🐛 Logalyzer Bug Test Shop

A deliberately broken Laravel application. Each route below triggers a different runtime error so that logalyzer can detect, analyse, and fix them.

TypeError

Dashboard — strtoupper(null)

config('app.custom_setting') returns null because the key does not exist. PHP 8 raises a TypeError when null is passed to strtoupper().

File: app/Http/Controllers/DashboardController.php:17

Trigger →
Null Dereference

User Profile — $user->name on null

User::find($id) returns null for unknown IDs, but the controller immediately accesses ->orders() without a null-check.

File: app/Http/Controllers/UserController.php:15

Trigger →
DivisionByZeroError

Product Detail — total_value / stock

Products seeded with stock = 0 cause a DivisionByZeroError when the controller computes the per-unit cost.

File: app/Http/Controllers/ProductController.php:16

Trigger →
Undefined Variable

Order Detail — $discountAmount out of scope

$discountAmount is only assigned inside an if ($order->has_discount) block. Orders without a discount leave it undefined, crashing the calculation below.

File: app/Http/Controllers/OrderController.php:22

Trigger →
QueryException

Monthly Report — unknown column revenue

The report uses SUM(revenue) in the SQL query, but the column is actually subtotal. MySQL raises SQLSTATE 42S22.

File: app/Http/Controllers/ReportController.php:15

Trigger →
BadMethodCallException

Inventory Status — getInventoryDetails() undefined

The controller calls $product->getInventoryDetails(), but that method was never implemented on the Product model.

File: app/Http/Controllers/InventoryController.php:16

Trigger →
How to use: Click Trigger → on any card to generate that error. Laravel's debug page will show the full stack trace. Logalyzer reads the application log at storage/logs/laravel.log and proposes a fix.