Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dev Tools Maker Bundle Laravel Package

edhrendal/dev-tools-maker-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. 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).

  2. 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.

  3. Where to Look First

    • Command Structure: Check app/Console/Commands/ for generated commands.
    • Configuration: Look for config/dev_tools.php (if auto-generated) for customizable settings.
    • Documentation: Review the GitHub README for Symfony-specific setup notes (adapt for Laravel as needed).

Implementation Patterns

Usage Patterns

  1. 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,
    ];
    
  2. 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.)

  3. Integration with Laravel

    • Service Providers: Bind generated commands or services to Laravel’s IoC container.
    • Artisan Commands: Extend Laravel’s Artisan facade to include new commands:
      Artisan::call('my-dev-tool:run');
      
  4. Configuration Override default settings in config/dev_tools.php (if applicable):

    return [
        'default_locale' => 'en_US',
        'debug_mode' => env('APP_DEBUG', false),
    ];
    

Workflows

  • Debugging: Use generated tools to log, dump, or inspect data during development.
  • Testing: Automate repetitive tasks (e.g., clearing caches, resetting databases) via CLI.
  • Collaboration: Share custom dev tools across a team by committing the generated commands to version control.

Gotchas and Tips

Pitfalls

  1. Symfony Dependency

    • The bundle is designed for Symfony, not Laravel. Expect compatibility issues (e.g., autowiring, service container differences).
    • Workaround: Use a bridge like symfony/maker-bundle or manually adapt the codebase.
  2. Limited Documentation

    • The package lacks detailed Laravel-specific guidance. Refer to Symfony’s MakerBundle docs for parallels.
    • Tip: Check the source code for clues on customization points.
  3. Command Registration

    • Generated commands may not auto-register in Laravel’s artisan command list.
    • Fix: Manually register commands in app/Console/Kernel.php or use package discovery.
  4. Namespace Conflicts

    • The bundle may generate classes with Symfony-style namespaces (e.g., Edhrendal\DevToolsMakerBundle).
    • Solution: Override the namespace in the generated files or configure the bundle to use Laravel’s conventions.

Debugging

  • Command Not Found: Ensure the command class extends Symfony\Component\Console\Command\Command (adapt for Laravel’s Illuminate\Console\Command).
  • Configuration Errors: Verify config/dev_tools.php exists and is properly loaded (Laravel may require a service provider).
  • Dependency Issues: Run composer dump-autoload if autoloading fails.

Tips

  1. 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
    
  2. Laravel-Specific Enhancements

    • Add Laravel-specific features (e.g., Eloquent model interactions, Blade templating) to generated commands.
    • Example:
      use App\Models\User;
      $users = User::all(); // Inside a generated command.
      
  3. 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);
    }
    
  4. 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();
    });
    
  5. 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
boundwize/pyrameter
testo/facade
headercat/phpstan-extension-ide-helper
yosymfony/parser-utils
innmind/black-box
babenkoivan/elastic-migrations
babenkoivan/elastic-adapter
sandermuller/package-boost-php
sandermuller/boost-core
depa/sulu-google-reviews-bundle
croct/plug-symfony
develia/commons
dmstr/symfony-system-resources-bundle
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
renatomarinho/laravel-page-speed
develia/geo-bundle
austinheap/laravel-database-encryption
dreamzy/livewire-charts
touchestate-sdk/php-sdk