πŸš€ Laravel Modular Package System

Comprehensive Roadmap & Documentation

πŸ“¦ Important: Package Installation Location

When installing Laravel packages via Composer, they are automatically placed in the /vendor directory of your Laravel application. This is the standard location for all third-party packages and dependencies managed by Composer.

composer require const-ant/laravel-corex

The package will be installed to: your-laravel-app/vendor/vendor-name/package-name/

⚑ Quick Installation Guide

  • Install the package via Composer:
    composer require const-ant/laravel-corex
  • Publish the configuration file:
    php artisan vendor:publish --tag=corex-module-migrations"
  • Create your first module:
    php artisan make:module BlogModule
  • Add Marketplace our module:
    php artisan module:marketplace install Module_Name
  • Enable our module:
    php artisan module:enable Module_Name
  • πŸ—οΈ
    Phase 1: Foundation Setup

    βœ… Completed Milestones

    πŸ“ Module /src Directory Structure

    Established a clear directory hierarchy to organize the package's components efficiently.

    πŸ”„ Composer PSR-4 Autoloading

    Configured Composer to autoload classes, adhering to PSR-4 standards for efficient class loading.

    βš™οΈ Service Provider Skeleton

    Created a base service provider to bootstrap the package's services within Laravel applications.

    πŸ› οΈ Custom Artisan Commands

    Integrated custom commands to facilitate package management and development tasks.

    🎯 Planned Enhancements

    πŸ“‹

    Module Contracts

    Introduce interfaces for clear module contracts

    πŸ“‘

    Event-Driven Architecture

    Implement custom events and listeners

    🧩

    Traits Directory

    Reusable behavior patterns across modules

    🎭

    Facade Class

    Static interface to core functionalities

    πŸ“‚ Suggested Final Directory Tree

    /vendor/const-ant-laravelcorex/
    └── src/
        β”œβ”€β”€ Config/
        β”œβ”€β”€ Console/
        β”‚   └── Commands/
        β”œβ”€β”€ Contracts/
        β”œβ”€β”€ Database/
        β”‚   └── Migrations/
        β”œβ”€β”€ Events/
        β”œβ”€β”€ Http/
        β”‚   └── Middleware/
        β”œβ”€β”€ Install/
        β”œβ”€β”€ Models/
        β”œβ”€β”€ Notifications/
        β”œβ”€β”€ Providers/
        β”œβ”€β”€ Repositories/
        β”œβ”€β”€ Resources/
        β”‚   β”œβ”€β”€ lang/
        β”‚   └── views/
        β”œβ”€β”€ Routes/
        β”œβ”€β”€ Services/
        └── Traits/
      

    πŸ”§
    Phase 2: Feature Integration & Custom Commands

    ✨ Feature Set Finalization

    πŸ“€ Configuration Publishing

    Implement functionality to publish package configuration files to the application's config directory.

    πŸ›£οΈ Route Loading

    Enable loading of module-specific routes seamlessly.

    πŸ‘οΈ View & Translation Publishing

    Allow publishing of views and translation files for customization.

    πŸ—„οΈ Migration Loading

    Facilitate the loading of module-specific database migrations.

    🎨 Creative Additions

    πŸ—οΈ

    make:module Command

    Scaffold new modules with predefined structure

    php artisan make:module BlogModule
    ⚑

    make:crud Command

    Auto-generate CRUD components

    php artisan make:crud Post --module=Blog
    πŸ“¦

    publish:module Command

    Publish module resources individually

    php artisan vendor:publish --tag=corex-module-migrations

    πŸ“š
    Phase 3: Developer Experience & Community

    πŸ‘¨β€πŸ’» Developer-Friendly Documentation

    πŸ“– README.md

    Comprehensive installation instructions, usage guidelines, and architectural overview.

    🀝 CONTRIBUTING.md

    Contribution guidelines, coding standards, and pull request procedures.

    πŸ“ CHANGELOG.md

    Maintain changelog following "Keep a Changelog" principles.

    βš–οΈ LICENSE

    Include open-source license such as MIT or Apache 2.0.

    🎯 Showcase Examples

    πŸ’‘

    Example Application

    Practical usage demonstration

    πŸ“š

    Step-by-Step Tutorials

    Module registration & customization guides

    πŸ”

    Dynamic Permissions

    Implementation examples

    πŸ§ͺ
    Phase 4: CI/CD, Testing & Code Quality

    βœ… Testing Strategy

    πŸ§ͺ

    Unit Tests

    Test service providers, commands, and core logic

    πŸ”—

    Integration Tests

    Test route functionalities and configuration publishing

    πŸ“Š

    PHPUnit Framework

    Comprehensive testing framework

    πŸš€ CI/CD Pipeline

    ⚑ GitHub Actions

    Automated workflows for linting, testing, and coverage reporting.

    πŸ“ˆ Code Quality Tools

    Integration with Code Climate or SonarQube for maintainability scoring.

    🌍
    Phase 5: Going Open Source on Packagist

    πŸš€ Prepare for Launch

  • GitHub Repository: Push the package to GitHub under personal or organizational namespace
  • Tags & Topics: Assign relevant topics (laravel, modular, package) for discoverability
  • Version Tagging: Tag the initial release as v1.0.0
  • Packagist Submission: Submit package for wider distribution
  • Webhooks Setup: Configure automatic updates
  • Usage Monitoring: Track statistics and downloads
  • πŸ”— How to Update Packages - Webhook Configuration

    πŸ™ GitHub Hook

    Enabling the Packagist service hook ensures automatic updates when you push to GitHub.

    Automatic Setup:
  • Log in via GitHub (reconnect if needed to grant required permissions)
  • Ensure Packagist application has access to all required GitHub organizations
  • Check package list for any sync warnings
  • Trigger manual account sync if needed (archived repositories cannot be setup)
  • Manual GitHub Webhook Setup:

    Payload URL: https://packagist.org/api/github?username=Rishabh6815

    Content Type: application/json

    Secret: Your Packagist API Token

    Events: Just the push event

    πŸ”· Bitbucket Webhooks

  • Go to your BitBucket repository settings
  • Select "Webhooks" in the menu
  • Add new hook with URL: https://packagist.org/api/bitbucket?username=Rishabh6815&apiToken=API_TOKEN
  • Save your changes
  • 🦊 GitLab Service

  • Go to GitLab repository Settings > Integrations
  • Search for Packagist in Project Services
  • Check "Active" box
  • Enter packagist.org username and API token
  • Save changes
  • 🌿 Gitea Webhook (v1.17+)

  • Go to Gitea repository Settings > Webhooks
  • Click "Add Webhook" and select "Packagist"
  • Enter packagist username, API token, and package URL
  • Save changes
  • πŸ”§ Manual Hook Setup

    For other Git providers, use this generic endpoint:

    curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=Rishabh6815&apiToken=API_TOKEN' -d'{"repository":{"url":"PACKAGIST_PACKAGE_URL"}}'

    Method: POST

    URL: https://packagist.org/api/update-package?username=Rishabh6815&apiToken=API_TOKEN

    Body: {"repository":{"url":"PACKAGIST_PACKAGE_URL"}}

    πŸ”‘ API Token & Security

    Find your API token on your Packagist profile page. For IP restrictions, Packagist maintains a list of public IPs for their workers.

    πŸ“ˆ
    Phase 6: Post-Launch Strategy & Growth

    πŸ› οΈ Developer Tools

    πŸ—οΈ Laravel Installer Package

    Create a package to scaffold new projects with the modular system:

    composer require const-ant/laravel-corex

    πŸ—ΊοΈ Feature Roadmap

    πŸ’»

    CLI Tool

    Command-line interface for module management

    πŸ“Š

    Module Management

    List, enable, disable modules

    πŸ”—

    Laravel Modules Integration

    Leverage existing module commands

    🌱 Community Growth

    πŸ“… Release Cadence

    Monthly release schedule to maintain momentum and deliver consistent updates.

    ✍️ Content Marketing

    Articles on dev.to, Medium, Hashnode about modular Laravel development.

    πŸ† Contributor Recognition

    Badges and acknowledgments for community contributors.

    πŸ›‘οΈ Long-Term Support

    LTS policy with backward compatibility following SemVer principles.

    🎯 Getting Started Checklist

  • βœ… Install via Composer
  • βš™οΈ Publish configuration
  • πŸ—οΈ Create your first module
  • πŸ”— Set up webhooks for automatic updates
  • πŸ“š Read the documentation
  • 🀝 Join the community discussions
  • πŸš€ Ready to Get Started?

    Transform your Laravel development with modular architecture!

    composer require const-ant/laravel-corex