Weave 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 Toolbox Bundle Laravel Package

akeneo-labs/dev-toolbox-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Steps

  1. Installation:

    • Add the VCS repository to composer.json:
      "repositories": [{
          "type": "vcs",
          "url": "https://github.com/akeneo-labs/DevToolboxBundle.git",
          "branch": "master"
      }]
      
    • Require the bundle:
      composer require akeneo-labs/dev-toolbox-bundle:v1.0.0
      
    • Register the bundle in app/AppKernel.php:
      $bundles[] = new Pim\Bundle\DevToolboxBundle\PimDevToolboxBundle();
      
  2. First Use Case:

    • Run the akeneo:attribute:delete command to delete an attribute:
      php bin/console akeneo:attribute:delete <attribute-code>
      
    • Run the akeneo:attribute:set-scopable command to change an attribute’s scope:
      php bin/console akeneo:attribute:set-scopable <attribute-code> <scope>
      
  3. Where to Look First:


Implementation Patterns

Usage Patterns

  1. Attribute Management:

    • Deleting Attributes: Use akeneo:attribute:delete to remove attributes safely (e.g., during development or cleanup). Confirm with --force if needed:
      php bin/console akeneo:attribute:delete --force <attribute-code>
      
    • Changing Scopes: Use akeneo:attribute:set-scopable to modify an attribute’s scope (e.g., ecommerce or master). Example:
      php bin/console akeneo:attribute:set-scopable product_reference master
      
  2. Workflow Integration:

    • Pre-Deployment Checks: Run commands in a staging environment to validate attribute changes before production.
    • CI/CD Pipelines: Automate attribute cleanup in CI/CD (e.g., GitHub Actions) for ephemeral environments:
      - name: Cleanup Attributes
        run: php bin/console akeneo:attribute:delete --force unused_attribute
      
  3. Leveraging Akeneo PIM:

    • Combine with Akeneo’s CLI tools (e.g., pim:attribute:create) for full attribute lifecycle management.

Gotchas and Tips

Pitfalls

  1. Scope Limitations:

    • Changing an attribute’s scope may break existing data or workflows. Test thoroughly in a non-production environment.
    • Example: Setting product_reference to master scope may disrupt product identification.
  2. Force Flag Misuse:

    • The --force flag bypasses confirmation prompts. Use cautiously to avoid accidental deletions:
      php bin/console akeneo:attribute:delete critical_attribute  # ❌ Avoid without confirmation
      php bin/console akeneo:attribute:delete --force critical_attribute  # ⚠️ Risky
      
  3. Dependency Conflicts:

    • Requires akeneo/pim-community-dev:~1.3. Ensure compatibility with your Akeneo version.

Debugging

  1. Command Errors:

    • Check logs for validation failures (e.g., invalid attribute codes or scopes). Example:
      [ERROR] Attribute "invalid_code" does not exist.
      
    • Use --verbose for detailed output:
      php bin/console akeneo:attribute:delete <code> --verbose
      
  2. Database Locks:

    • Commands may fail if Akeneo’s database is locked. Retry or check for long-running processes.

Tips

  1. Backup First:

    • Always back up your database before running destructive commands:
      mysqldump -u [user] -p[password] [database] > backup.sql
      
  2. Batch Processing:

    • For multiple attributes, create a script to loop through codes:
      for code in $(cat attributes_to_delete.txt); do
        php bin/console akeneo:attribute:delete --force "$code"
      done
      
  3. Extension Points:

    • Customize behavior by overriding the bundle’s services (e.g., add pre-delete hooks via dependency injection).
    • Example in config/services.yaml:
      Pim\Bundle\DevToolboxBundle\Command\AttributeDeleteCommand:
        arguments:
          $attributeManager: '@custom.attribute_manager'
      
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource