Welcome to RCV Core
A powerful modular package system for Laravel that enables clean, organized, and scalable application architecture through module-based development.
What is RCV Core?
RCV Core is a comprehensive modular package system designed specifically for Laravel applications. It provides developers with the tools and structure needed to build scalable, maintainable applications using a module-based architecture.
Modular Architecture
Organize your application into logical modules with clear separation of concerns.
Developer Friendly
Intuitive commands and structure that accelerate development workflow.
Extensible
Easy to extend and customize according to your project requirements.
Package Management
Seamless integration with Composer and Laravel's ecosystem.
Package Location
When installed via Composer, RCV Core is automatically placed in your Laravel application's vendor directory:
your-laravel-app/vendor/rcv/core/
Installation
Get started with RCV Core in your Laravel application in just a few steps.
Requirements
- Laravel 9.x or higher
- PHP 8 or higher
- Composer
Installation Steps
Install via Composer
Add RCV Core to your Laravel project using Composer:
composer require rcv/core
Publish Configuration
Publish the configuration and migration files:
php artisan vendor:publish --tag=core-module-migrations
Run Migrations
Execute the database migrations:
php artisan migrate
Create Your First Module
Generate a new module to start building:
php artisan module:make YourModuleName
Quick Start Guide
Start building with RCV Core in minutes with this comprehensive quick start guide.
1. Create a Module
Generate a new module with all necessary files and structure:
php artisan module:make YourModuleName
2. Add to Marketplace
Register your module in the marketplace:
php artisan module:marketplace install YourModuleName
3. Enable Module
Activate your module to make it available:
php artisan module:enable YourModuleName
Congratulations!
You've successfully set up RCV Core and created your first module. You're now ready to start building scalable, modular Laravel applications.
Architecture
Understanding the core architecture and design principles of RCV Core.
Directory Structure
/vendor/rcv/core/ └── src/ ├── Config/ # Configuration files ├── Console/ # Artisan commands │ └── Commands/ ├── Database/ # Migrations and seeders │ └── Migrations/ ├── Http/ # HTTP related files │ ├── Controllers/ │ └── Middleware/ ├── Models/ # Eloquent models ├── Providers/ # Service providers ├── Resources/ # Views and assets │ ├── views/ │ └── lang/ ├── Routes/ # Route definitions └── Services/ # Business logic services
Design Principles
Separation of Concerns
Each module handles a specific domain of your application.
Dependency Injection
Leverages Laravel's service container for better testability.
Convention over Configuration
Follows Laravel conventions to reduce configuration overhead.
Extensibility
Easy to extend and customize through hooks and events.
Modules
Learn about creating and managing modules in RCV Core.
What are Modules?
Modules in RCV Core are self-contained packages that encapsulate specific functionality. Each module can have its own controllers, models, views, routes, and other Laravel components.
Self-Contained
Each module is independent and can be developed, tested, and deployed separately.
Reusable
Modules can be easily shared across different projects and applications.
Configurable
Modules can be easily configured and customized for different use cases.
Testable
Each module can have its own test suite for thorough testing.
Creating a Module
Use the artisan command to create a new module:
php artisan module:make YourModuleName
Commands
Comprehensive list of all available RCV Core commands organized by category.
Artisan Commands
RCV Core provides a suite of 50+ Artisan commands to streamline module management and development tasks, tightly integrated with Laravel's ecosystem.
Module Management Commands
13 commandsmodule:make
Create a new module with all necessary files and structure.
php artisan module:make ModuleName
module:enable
Enable a specific module to make it active in the application.
php artisan module:enable ModuleName
module:disable
Disable a specific module to make it inactive.
php artisan module:disable ModuleName
module:list
Display a list of all available modules and their status.
php artisan module:list
module:show
Show detailed information about a specific module.
php artisan module:show ModuleName
module:install
Install a module from the marketplace.
php artisan module:install ModuleName
module:remove
Remove a module from the application.
php artisan module:remove ModuleName
module:update
Update a module to the latest version.
php artisan module:update ModuleName
module:publish
Publish module resources such as configuration files or views.
php artisan module:publish ModuleName
module:state
Show the current state of a module.
php artisan module:state ModuleName
module:debug
Debug module configuration and dependencies.
php artisan module:debug ModuleName
module:dependency-graph
Display module dependency graph.
php artisan module:dependency-graph
module:health-check
Perform health check on all modules.
php artisan module:health-check
Component Generation Commands
25 commandsmodule:make-controller
Generate a controller in the specified module. Use --api or --resource flags for specific types.
php artisan module:make-controller ModuleName ControllerName
module:make-model
Generate an Eloquent model in the specified module.
php artisan module:make-model ModuleName ModelName
module:make-migration
Generate a database migration file in the specified module.
php artisan module:make-migration ModuleName migration_name
module:make-seeder
Generate a database seeder in the specified module.
php artisan module:make-seeder ModuleName SeederName
module:make-factory
Generate a model factory in the specified module.
php artisan module:make-factory ModuleName FactoryName
module:make-service
Generate a service class in the specified module.
php artisan module:make-service ModuleName ServiceName
module:make-repository
Generate a repository pattern class in the specified module.
php artisan module:make-repository ModuleName RepositoryName
module:make-request
Generate a form request class in the specified module.
php artisan module:make-request ModuleName RequestName
module:make-resource
Generate an API resource class in the specified module.
php artisan module:make-resource ModuleName ResourceName
module:make-middleware
Generate a middleware class in the specified module.
php artisan module:make-middleware ModuleName MiddlewareName
module:make-event
Generate an event class in the specified module.
php artisan module:make-event ModuleName EventName
module:make-listener
Generate an event listener class in the specified module.
php artisan module:make-listener ModuleName ListenerName
module:make-notification
Generate a notification class in the specified module.
php artisan module:make-notification ModuleName NotificationName
module:make-job
Generate a queueable job class in the specified module.
php artisan module:make-job ModuleName JobName
module:make-policy
Generate a policy class in the specified module.
php artisan module:make-policy ModuleName PolicyName
module:make-rule
Generate a validation rule class in the specified module.
php artisan module:make-rule ModuleName RuleName
module:make-route-provider
Generate a route service provider in the specified module.
php artisan module:make-route-provider ModuleName
module:make-view
Generate a Blade view file in the specified module.
php artisan module:make-view ModuleName ViewName
module:make-helper
Generate a helper class in the specified module.
php artisan module:make-helper ModuleName HelperName
module:make-scope
Generate an Eloquent scope class in the specified module.
php artisan module:make-scope ModuleName ScopeName
module:make-exception
Generate an exception class in the specified module.
php artisan module:make-exception ModuleName ExceptionName
module:make-action
Generate an action class in the specified module.
php artisan module:make-action ModuleName ActionName
module:make-cast
Generate a custom cast class in the specified module.
php artisan module:make-cast ModuleName CastName
module:make-channel
Generate a broadcast channel class in the specified module.
php artisan module:make-channel ModuleName ChannelName
module:make-component-view
Generate a view component in the specified module.
php artisan module:make-component-view ModuleName ComponentName
Development & Maintenance Commands
7 commandsmodule:migrate
Run database migrations for a specific module.
php artisan module:migrate ModuleName
module:migrate-rollback
Rollback database migrations for a specific module.
php artisan module:migrate-rollback ModuleName
module:seed
Run database seeders for a specific module.
php artisan module:seed ModuleName
module:route-list
Display all routes for a specific module.
php artisan module:route-list ModuleName
module:autoload
Regenerate module autoload files.
php artisan module:autoload
module:backup
Create a backup of a specific module.
php artisan module:backup ModuleName
module:clear-compiled
Clear compiled module cache files.
php artisan module:clear-compiled
Module Migration Commands
2 commandsmodule:discover
Discover and register all available modules.
php artisan module:discover
module:migrate-v1-to-v2
Migrate from RCV Core v1 to v2 structure.
php artisan module:migrate-v1-to-v2
Module Testing Commands
1 commandmodule:update-phpunit-coverage
Update PHPUnit test coverage configuration for modules.
php artisan module:update-phpunit-coverage
Additional Generation Commands
6 commandsmodule:make-enum
Generate an enum class in the specified module.
php artisan module:make-enum ModuleName EnumName
module:make-interface
Generate an interface in the specified module.
php artisan module:make-interface ModuleName InterfaceName
module:make-mail
Generate a mailable class in the specified module.
php artisan module:make-mail ModuleName MailName
module:make-artisan
Generate a custom Artisan command in the specified module.
php artisan module:make-artisan ModuleName CommandName
module:make-observer
Generate a model observer class in the specified module.
php artisan module:make-observer ModuleName ObserverName
module:make-trait
Generate a trait in the specified module.
php artisan module:make-trait ModuleName TraitName
Configuration
Customize and manage RCV Core settings to suit your application needs.
Configuration Overview
RCV Core provides flexible configuration options to tailor the package to your project's requirements. Configuration files can be published and customized as needed.
Publishing Configuration
Publish the configuration file to your Laravel application:
php artisan module:publish-config ModuleName
This will create a configuration file at config/rcv-core.php
where you can customize
module settings, paths, and more.
Customizable Settings
Adjust module paths, enable/disable features, and configure middleware.
Environment Integration
Seamlessly integrate with Laravel's environment variables.
Configuration Files
Manage module-specific configurations independently.
Hooks & Events
Leverage hooks and events to extend and customize RCV Core functionality.
Extending with Hooks
RCV Core supports hooks and events to allow developers to extend functionality without modifying core code.
Event Listeners
Register listeners for module lifecycle events like enabling or disabling modules.
Custom Hooks
Create custom hooks to trigger specific actions during module operations.
Event-Driven Architecture
Utilize Laravel's event system for seamless integration.
Example: Registering an Event Listener
Add an event listener in your module's service provider:
Event::listen('module.enabled', function ($module) {
Log::info("Module {$module} has been enabled.");
});
Testing
Ensure the quality and reliability of your modules with comprehensive testing.
Testing Strategy
RCV Core integrates with Laravel's testing framework to provide robust unit and integration testing capabilities for your modules.
Unit Tests
Test individual components like services and commands in isolation.
Integration Tests
Test module interactions with the Laravel application.
PHPUnit Integration
Leverage PHPUnit for comprehensive testing coverage.
Running Tests
Execute your module tests using PHPUnit:
vendor/bin/phpunit --filter ModuleName
Testing Complete
Your modules are now tested and ready for production deployment.