Download the PHP package vivek-mistry/repository-interface without Composer
On this page you can find all versions of the php package vivek-mistry/repository-interface. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vivek-mistry/repository-interface
More information about vivek-mistry/repository-interface
Files in vivek-mistry/repository-interface
Package repository-interface
Short Description Laravel package for dependency injection to separate business logic.
License MIT
Homepage https://github.com/vivek-mistry/repository-interface
Informations about the package repository-interface
Laravel Repository Interface
A Laravel package that leverages dependency injection to cleanly separate business logic from other application layers, promoting better code organization, testability, and adherence to SOLID principles
🛠️ Installation
Install the package via Composer:
Get Plain Repository Interface
Particular Model Generate the Repository-Interface
With basic functions you will get here like,
- public function createOrUpdate(array $data, $id = null);
- public function getAll($draw = null, $start = null, $rawperpage = null);
- public function getRecordById($id, array $with = []);
- public function getRecordByField(string $field_name, string $field_value);
So using above two files created at app/Repositories/Interface & app/Repositories/Repository
- ModelNameInterface.php
- ModelNameInterfaceRepository.php
Create Service Prvider
Register Your Service Provider & register your repository
=> Register your service provider
=> In your RepositoryServiceProvider add below :
HOW TO USE IN YOUR CONTROLLER?
For example :
Testing
Change Logs
Date : 27 Sept, 2025
- Update the Minor bugs of functions
- Added Plain Repository/Interface
Credits
- Vivek Mistry - Project creator and maintainer
License
MIT License. See LICENSE for details.