shakib53626 / laravel-repository-maker
The shakib53626/laravel-repository-maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository), developers can automatically generate repository classes with pre-defined methods like index, store, u
Requires
- php: >=8.0
This package is auto-updated.
Last update: 2025-06-14 07:22:49 UTC
README
The Laravel Repository Maker package provides a simple and efficient way to implement the Repository Design Pattern in Laravel projects. With a custom Artisan command (make:repository
), developers can automatically generate repository classes with pre-defined methods like index
, store
, update
, and delete
.
This tool is designed to enhance modularity, promote clean architecture, and save development time.
Installation
You can install the package via Composer.
- Run
composer require
to require the package:composer require shakib53626/laravel-repository-maker:dev-master
Usage
Once the package is installed, you can use the custom Artisan command to generate repository classes.
To generate a new repository, run:
php artisan make:repository TestRepository
This command will create a UserRepository
class in the app/Repositories
directory with default methods.
Generated Repository Structure
The generated repository class will include the following methods:
index()
: Logic for listing resourcesstore()
: Logic for storing a new resourceshow()
: Logic for displaying a single resourceupdate()
: Logic for updating a resourcedelete()
: Logic for soft-deleting a resourcetrashList()
: Logic for listing trashed resourcesrestore()
: Logic for restoring a trashed resourcepermanentDelete()
: Logic for permanently deleting a resource
Configuration
This package doesn't require any configuration out of the box. However, you can customize the generated repository methods according to your needs.
License
This package is licensed under the MIT License. See the LICENSE file for more information.
Contributing
If you'd like to contribute to the package, feel free to fork the repository and submit a pull request.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/your-feature
). - Create a new Pull Request.
Author
- Shakibul Islam
Email: diu.shakib@gmail.com