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

Laravel Package Maker Laravel Package

backtheweb/laravel-package-maker

Laravel Package Maker helps scaffold Laravel packages quickly by generating a ready-to-publish structure, boilerplate classes, config, service provider, tests, and composer setup. Ideal for jumpstarting reusable components and standardizing package creation.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Purpose Alignment: The package is designed to accelerate Laravel package development by automating boilerplate setup (e.g., composer.json, src/, tests/, config/, and migrations/). This aligns perfectly with a TPM’s goal of reducing technical debt in package-based architectures (e.g., modular monoliths, microservices, or plugin systems).
  • Laravel Ecosystem Synergy: Leverages Laravel’s service provider, facade, and publisher patterns natively, ensuring seamless integration with existing Laravel applications or package repositories.
  • Customization Flexibility: Supports custom templates (via --template flag) and predefined skeletons (e.g., API packages, CLI tools), allowing TPMs to enforce consistent package structures across teams.

Integration Feasibility

  • Low Friction: Single CLI command (php artisan package:make) replaces manual scaffolding, reducing onboarding time for developers.
  • Composer Integration: Generates PSR-compliant package structures, ensuring compatibility with Laravel’s autoloading and dependency management.
  • IDE/Tooling Support: Outputs files with PHPStan, Pest, and Laravel Pint configs by default, easing adoption in modern PHP workflows.

Technical Risk

  • Template Rigidity: Hardcoded templates may limit domain-specific customizations (e.g., custom namespace prefixes, unique testing frameworks). Mitigation: Extend via custom templates or post-generation scripts.
  • Version Skew Risks: Package assumes Laravel ≥8.x. Downgrade risks exist for older apps. Mitigation: Validate Laravel version in CI or use conditional logic.
  • Dependency Bloat: Auto-includes laravel/package-tools (for publishing). May conflict with existing tooling. Mitigation: Audit dependencies post-generation.

Key Questions

  1. Team Adoption:
    • Will developers resist CLI-based scaffolding in favor of manual control?
    • How will custom templates be version-controlled and shared across teams?
  2. Package Governance:
    • Should generated packages enforce specific coding standards (e.g., PSR-12, custom rules) via template overrides?
    • How will package naming conventions (e.g., vendor/package-name) be standardized?
  3. CI/CD Impact:
    • Will generated packages require additional CI steps (e.g., dependency audits, security scans)?
    • How will package updates (e.g., Laravel version bumps) be managed post-generation?
  4. Long-Term Maintenance:
    • Who owns template updates (e.g., adding new Laravel features like Jetstream support)?
    • How will deprecated package structures be phased out?

Integration Approach

Stack Fit

  • Primary Use Case: Ideal for Laravel-first stacks (e.g., Lumen, Livewire, or Forge-based deployments). Less relevant for non-Laravel PHP (e.g., Symfony, plain Slim).
  • Complementary Tools:
    • Pair with Laravel Forge for deployment consistency.
    • Integrate with GitHub/GitLab Templates to pre-populate repos with package skeletons.
    • Use with Laravel Vapor for serverless package deployments.

Migration Path

  1. Pilot Phase:
    • Generate 1–2 packages using the CLI, then manually review structures.
    • Document deviations (e.g., missing README.md sections) to refine templates.
  2. Template Standardization:
    • Create team-specific templates (e.g., api-package, cli-tool) in a shared templates/ directory.
    • Example:
      php artisan package:make MyApiPackage --template=api-package --namespace=App\\Packages
      
  3. CI/CD Automation:
    • Add a pre-commit hook or GitHub Action to validate package structure.
    • Example workflow:
      - name: Validate Package Structure
        run: php artisan package:validate MyPackage
      
  4. Deprecation Strategy:
    • Phase out manual package creation via documentation/onboarding.
    • Archive old templates in templates/legacy/.

Compatibility

  • Laravel Versions: Tested on Laravel 8+. For Laravel 7, use --force and manually adjust config/ paths.
  • PHP Versions: Requires PHP ≥8.0 (due to Laravel 8+ dependencies). Downgrade via composer.json overrides if needed.
  • Tooling Conflicts:
    • Resolve laravel/package-tools conflicts by either:
      • Using --no-dev flag for production packages.
      • Merging configs post-generation.

Sequencing

  1. Pre-Integration:
    • Audit existing packages for inconsistent structures (e.g., mixed src/ vs. root-level classes).
    • Define package naming and namespace conventions.
  2. Initial Rollout:
    • Generate new packages only (avoid retrofitting old ones).
  3. Post-Rollout:
    • Gradually migrate legacy packages to the new structure via refactoring scripts.
    • Example script to move classes from root to src/:
      find . -name "*.php" -not -path "./src/*" -exec mv {} src/ \;
      

Operational Impact

Maintenance

  • Template Updates:
    • Pros: Centralized control via Git-managed templates.
    • Cons: Template changes require team coordination (e.g., breaking changes in composer.json).
    • Mitigation: Use semantic versioning for templates (e.g., templates/v2/).
  • Dependency Management:
    • Auto-generated composer.json may include unnecessary dev dependencies. Audit and prune post-generation.
    • Example:
      composer remove --dev pestphp/pest laravel/package-tools
      

Support

  • Developer Onboarding:
    • Reduces context-switching by standardizing package structures.
    • Risk: Developers may blame the tool for "rigid" structures. Mitigate with customizable templates.
  • Troubleshooting:
    • Common issues:
      • Namespace collisions: Enforce vendor/package-name in templates.
      • Missing configs: Add php artisan package:publish to onboarding docs.
    • Debugging Command: Use --verbose flag for CLI output.

Scaling

  • Package Repository Growth:
    • Pros: Faster iteration with consistent scaffolding.
    • Cons: Template bloat if too many customizations are added. Solution: Use composable templates (e.g., base-package + api-features).
  • Performance:
    • CLI command is lightweight (no runtime overhead post-generation).
    • Large teams: Cache templates locally to avoid GitLab/GitHub template fetches.

Failure Modes

Failure Scenario Impact Mitigation
Corrupted template files Broken package structure Pin template versions in composer.json
Laravel version mismatch Package fails to register Add version checks in bootstrap.php
Dependency conflicts CI/CD pipeline failures Use composer why-not to debug
Template not found CLI command fails Document template paths in README
Post-generation manual edits Inconsistent package structures Enforce pre-commit hooks

Ramp-Up

  • Training:
    • 15-minute workshop: Demo CLI command + template customization.
    • Cheat Sheet: Include common flags (e.g., --no-interaction, --force).
  • Documentation:
    • Template Guide: Show how to extend default templates.
    • Example Repo: Publish a laravel-package-template repo with team-specific configs.
  • Metrics to Track:
    • Adoption Rate: % of new packages created via CLI.
    • Consistency: % of packages matching template structure.
    • Developer Feedback: Survey on template flexibility.
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.
encore2/laravel-admin2
cboxdk/laravel-console-kit
shapecode/doctrine-dbal-datetimeutc
gilads-otiannoh254/inertia-protocol
dakiquang/laravel-oauth-refresh-lock
woda/laravel-worktrees
dalefranks/ramasite
faghy/laracashbook
roundly-consulting/google-places-for-laravel
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
adachsoft/cli-process-tester
adachsoft/changelog-linter
adachsoft/collection
adachsoft/php-code-style
adachsoft/api-version-bundle
cgv/localized-resource