Solution:
That's a really interesting project! For those interested in integrating the Squiz debugger with their Laravel application, here are the steps to get started:
- Install Squiz via Composer:
Navigate to your Laravel project's root directory and run:
composer require chisnall/squiz --dev
- Publish the Configuration File:
If you want to customize the configuration, you can publish it:
php artisan vendor:publish --provider="Squiz\SquizServiceProvider"
- Usage:
To use dump() or Squiz::view() in your application, simply call the helper or use the facade:
// Typical usage in your controller or route
dump($variable);
// Or, using Squiz facade (ensure you've imported the class)
use Squiz\Squiz;
Squiz::view();
- View Dumps on a Single Live Page:
Once you have Squiz running, open the dedicated viewer by visiting /squiz in your browser (e.g. http://localhost:8000/squiz). Here you'll see all your dumps and debug info live as your app runs.
- Environment Restriction:
By default, Squiz only works in local or development environments to avoid leaking debug info in production. Make sure APP_ENV=local in your .env file.
Summary:
- Install with Composer:
composer require chisnall/squiz --dev - Use
dump()orSquiz::view()in your code. - View your debug output live at
/squiz.
For more detailed documentation, visit the Squiz GitHub page.
