aidias / gelb-repository
Repository structure for Laravel applications
Installs: 910
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Type:package
pkg:composer/aidias/gelb-repository
Requires
- php: ^7.2
 
This package is auto-updated.
Last update: 2025-10-29 02:16:25 UTC
README
Repository structure for Laravel applications.
Getting Started
These instructions will get you a copy of the project up and running.
Prerequisites
- Laravel >= 5.8
 - PHP >= 7.2
 
Installing
- You will need composer and a Laravel project set in your development environment. Then, run the following command in terminal:
 
composer require aidias/gelb-repository
- After the package installation, run:
 
php artisan gelb:repository:init
This will create the following GelbRepository structure in your Laravel app:
app\Providers\RepositoryServiceProvider.php: This is the service provider for the repository injections.app\Repositories: It will contain all repositories related files;app\Repositories\Interfaces\AbstractInterface.php: This interface will have a common basic rules for others repositories implementation;app\Repositories\Eloquent\AbstractEloquent.php: This is the Eloquent implementation for theAbstractInterface.php. You can use other framework by using the this guide;
- Register the 
RepositoryServiceProviderinconfig\app.phpat providers array: 
'providers' => [ ... App\Providers\RepositoryServiceProvider::class, ... ],
Usage
- For example, to create a 
Postrepository, run: 
php artisan gelb:make:repository Post
This will create the following files (if they don't exist already):
app\Http\Controllers\PostController.phpapp\Http\Requests\PostStoreRequest.phpapp\Http\Requests\PostUpdateRequest.phpapp\Repositories\Eloquent\PostEloquent.phpapp\Repositories\Interfaces\PostInterface.phpapp\Post.php
Authors
- Rafael Casachi - Initial work - Website
 - Cristiano Fromagio - Contributor - GitHub
 - Leandro Cuminato - Contributor - GitHub
 
License
This project is licensed under the MIT License - see the LICENSE.md file for details.