siguici/laravel-devtools
A lightweight set of dev tools for Laravel to speed up local development. Adds helpful debugging and productivity utilities you can enable in development environments to inspect requests, log output, and streamline common workflow tasks.
Installation
composer require --dev siguici/laravel-devtools
Publish the config (if needed):
php artisan vendor:publish --provider="Siguici\DevTools\DevToolsServiceProvider" --tag="config"
First Use Case: Debugging Routes Run the route inspector:
php artisan devtools:routes
This lists all registered routes with their methods, middleware, and namespaces.
Quick Wins
devtools:view to inspect Blade templates and their sections.php artisan devtools:queues.Debugging Middleware
Use php artisan devtools:middleware to list all middleware groups and their bindings. Combine with php artisan route:list to trace middleware execution paths.
Database Schema Exploration Generate a visual schema diagram:
php artisan devtools:schema --output=public/schema.png
Integrate this into CI/CD pipelines for documentation.
Artisan Command Automation Automate repetitive tasks (e.g., clearing caches, optimizing configs):
php artisan devtools:optimize
Environment-Specific Checks Validate environment variables with:
php artisan devtools:env
Useful for local vs. production parity checks.
devtools:routes to deployment scripts to audit routes post-deploy.devtools:assets to debug asset compilation issues.DevTools\Assertions for custom assertions (e.g., route existence checks).Performance Overhead
Avoid running devtools:routes or devtools:schema in production. These commands are dev-only and may lock tables or slow down the app.
Config Conflicts
If publishing the config, ensure devtools.php doesn’t override critical Laravel settings (e.g., app.debug). Defaults are safe, but custom values may break expected behavior.
Deprecated Features
The package is archived (last release: 2026). Some commands (e.g., devtools:cache) may rely on Laravel 10+ features. Test thoroughly on your Laravel version.
Blade Template Caching
devtools:view may return stale data if Blade templates are cached. Clear the view cache first:
php artisan view:clear
devtools:queues may exit silently if the queue driver is misconfigured. Add --verbose for details:
php artisan devtools:queues --verbose
php artisan devtools:routes --json to pipe output to tools like jq for programmatic analysis:
php artisan devtools:routes --json | jq '.[] | select(.method == "GET")'
dd() in middleware methods to trace execution:
public function handle($request, Closure $next) {
dd('Middleware hit', $request->route()->uri); // Debug here
return $next($request);
}
Custom Commands Extend the package by creating a custom Artisan command that leverages its helpers:
use Siguici\DevTools\Support\Facades\DevTools;
class MyCustomCommand extends Command {
protected $signature = 'my:command';
public function handle() {
$routes = DevTools::routes();
// Custom logic...
}
}
Hooks Override default behaviors by binding your own implementations to the package’s service container. Example:
$this->app->bind(
\Siguici\DevTools\Contracts\RouteInspector::class,
MyCustomRouteInspector::class
);
Asset Debugging
Use the devtools:assets output to generate a custom asset manifest for your frontend build process.
How can I help you explore Laravel packages today?