Download the PHP package visiarch/laravel-repository without Composer
On this page you can find all versions of the php package visiarch/laravel-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download visiarch/laravel-repository
More information about visiarch/laravel-repository
Files in visiarch/laravel-repository
Package laravel-repository
Short Description A simple Laravel package to create repository, using artisan commands
License MIT
Homepage https://github.com/visiarch/laravel-repository
Informations about the package laravel-repository
laravel-repository
A Simple Package to create repositories, using artisan commands in laravel.
This package extends the make:
commands to help you easily create repository classes in Laravel 9+.
What is Repository ?
Repository is a design pattern used to manage data access logic. It provides abstraction between the application and data access layers, such as databases.
Install
Once it is installed, you can use any of the commands in your terminal.
Usage
Repositories are used to separate data access logic from business logic, allowing developers to change how data is stored and retrieved without affecting business logic.
With interface
Without interface
Examples
Create a repository class with interface
app/Repositories/Interfaces/PostRepositoryInterface.php
app/Repositories/PostRepository.php
app\Providers\AppServiceProvider
Create a repository class without interface
app/Repositories/PostRepository.php
Implementation
With Interface
Without Interface
How to implement it on the controller?
Contributing
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
How can I thank you?
Why not star the github repo? I'd love the attention! Why not share the link for this repository on any social media? Spread the word!
Thanks! visiarch
License
The MIT License (MIT). Please see License File for more information.