Download the PHP package jaikumar0101/laravel-repo-facade-builder without Composer
On this page you can find all versions of the php package jaikumar0101/laravel-repo-facade-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jaikumar0101/laravel-repo-facade-builder
More information about jaikumar0101/laravel-repo-facade-builder
Files in jaikumar0101/laravel-repo-facade-builder
Package laravel-repo-facade-builder
Short Description Laravel package for creating repositories, facades, enums, and other OOP containers using artisan commands
License MIT
Informations about the package laravel-repo-facade-builder
Laravel Repo Facade Builder
A Laravel package that provides convenient Artisan commands for creating repositories, facades, enums, interfaces, and traits with proper namespace support and subfolder handling.
Features
- 🚀 Repository Pattern: Create repositories with interfaces
- 🎭 Facades: Generate Laravel facade classes
- 📋 Enums: Create PHP 8.1+ enum classes with backing types
- 🔌 Interfaces: Generate interface files
- 🧩 Traits: Create reusable trait files
- ⚙️ Services: Generate service classes
- 📁 Subfolder Support: All commands support nested folder structures
- ✨ Auto-namespace: Automatically handles namespaces based on folder structure
Requirements
- PHP 8.1 or higher
- Laravel 10.x or 11.x
Installation
Install the package via Composer:
The service provider will be automatically registered via Laravel's package discovery.
Usage
Make Repository
Create a repository with its interface:
This creates:
app/Repositories/UserRepositoryInterface.phpapp/Repositories/UserRepository.php
With subfolders:
This creates:
app/Repositories/Accounting/Bill/CreditNoteRepositoryInterface.phpapp/Repositories/Accounting/Bill/CreditNoteRepository.php
Make Facade
Create a Laravel facade:
This creates:
app/Facades/Payment.php
With subfolders:
This creates:
app/Facades/Services/Payment.php
Make Enum
Create an enum class:
With backing type:
This creates:
app/Enums/Status.php
With subfolders:
This creates:
app/Enums/Constants/OrderStatus.php
Make Interface
Create an interface:
This creates:
app/Interfaces/PaymentGatewayInterface.php
With subfolders:
This creates:
app/Interfaces/Contracts/Payment/GatewayInterface.php
Make Trait
Create a trait:
This creates:
app/Traits/HasUuid.php
With subfolders:
This creates:
app/Traits/Concerns/HasSlug.php
Make Service
Create a service class:
This creates:
app/Services/UserService.php
With subfolders:
This creates:
app/Services/Payment/Stripe/StripePaymentService.php
Examples
Complete Repository Pattern Example
Generated files:
UserRepositoryInterface.php:
UserRepository.php:
Enum with Backing Type
Generated file:
Facade Example
Generated file:
Folder Structure
The package creates files in the following directories:
Benefits
- Consistent Structure: Maintains a clean and consistent project structure
- Time-Saving: Quickly scaffold common OOP patterns
- Namespace Management: Automatically handles complex namespace hierarchies
- Best Practices: Follows Laravel and PHP best practices
- Flexible: Supports any level of folder nesting
Testing
The package includes a comprehensive test suite. To run the tests:
Running Specific Tests
Test Coverage
The test suite covers:
- ✅ Repository creation with interfaces
- ✅ Facade generation
- ✅ Enum creation with backing types
- ✅ Interface generation
- ✅ Trait creation
- ✅ Service creation
- ✅ Subfolder support for all commands
- ✅ Namespace handling
- ✅ Directory creation
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Jaikumar0101
Support
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Changelog
[Unreleased]
Added
- New
make:servicecommand to generate service classes inapp/Services/directory - Support for subfolder structures in service generation
- Comprehensive test coverage for service command
All versions of laravel-repo-facade-builder with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0