edhrendal/dev-tools-maker-bundle
Installation Add the bundle to your Laravel project via Composer:
composer require edhrendal/dev-tools-maker-bundle
Register the bundle in config/app.php under the ExtraBundles key (Symfony-specific, but adaptable for Laravel via bridge packages like symfony/maker-bundle if needed).
First Use Case
Run the make:dev-tool command to generate a basic dev tool scaffold:
php artisan make:dev-tool MyDevTool
This creates a new command class in app/Console/Commands/MyDevToolCommand.php with a basic structure for CLI-based dev utilities.
Where to Look First
app/Console/Commands/ for generated commands.config/dev_tools.php (if auto-generated) for customizable settings.CLI Dev Tools Extend the generated command class to add custom logic:
// app/Console/Commands/MyDevToolCommand.php
protected function handle()
{
$this->info('Running custom dev tool logic...');
// Add your logic here (e.g., database queries, file operations).
}
Register the command in app/Console/Kernel.php:
protected $commands = [
Commands\MyDevToolCommand::class,
];
Reusable Components Use the bundle to scaffold shared dev utilities (e.g., data seeding, API testing helpers):
php artisan make:dev-tool --name=DataSeeder --type=seeder
(Note: Customize --type if the bundle supports it.)
Integration with Laravel
Artisan facade to include new commands:
Artisan::call('my-dev-tool:run');
Configuration
Override default settings in config/dev_tools.php (if applicable):
return [
'default_locale' => 'en_US',
'debug_mode' => env('APP_DEBUG', false),
];
Symfony Dependency
symfony/maker-bundle or manually adapt the codebase.Limited Documentation
Command Registration
artisan command list.app/Console/Kernel.php or use package discovery.Namespace Conflicts
Edhrendal\DevToolsMakerBundle).Symfony\Component\Console\Command\Command (adapt for Laravel’s Illuminate\Console\Command).config/dev_tools.php exists and is properly loaded (Laravel may require a service provider).composer dump-autoload if autoloading fails.Customize the Maker Extend the bundle’s maker logic by overriding its templates or adding new command types:
php artisan make:dev-tool --custom=MyCustomTemplate
Laravel-Specific Enhancements
use App\Models\User;
$users = User::all(); // Inside a generated command.
Testing Write PHPUnit tests for custom commands:
public function test_my_dev_tool()
{
$this->artisan('my-dev-tool:run')
->expectsOutput('Running custom dev tool logic...')
->assertExitCode(0);
}
Performance Cache command outputs or heavy operations if used frequently:
$cacheKey = 'my_dev_tool_data';
$data = Cache::remember($cacheKey, now()->addHours(1), function () {
return $this->fetchExpensiveData();
});
Extending the Bundle
Fork the repository and modify the maker templates (located in Resources/skeleton/) to fit Laravel’s patterns. Submit PRs to improve upstream compatibility.
How can I help you explore Laravel packages today?