Download the PHP package jason-guru/laravel-make-repository without Composer
On this page you can find all versions of the php package jason-guru/laravel-make-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jason-guru/laravel-make-repository
More information about jason-guru/laravel-make-repository
Files in jason-guru/laravel-make-repository
Package laravel-make-repository
Short Description A simple package to create a make:repository command for Laravel 10, 11, and 12.
License MIT
Informations about the package laravel-make-repository
Laravel PHP Artisan Make:Repository
A simple package that adds a php artisan make:repository command to Laravel 10, 11, 12, and 13.
Installation
Require the package with composer:
Or add it to your composer.json require-dev section and run composer update:
Usage
Example:
Or with a sub-namespace:
Wire up a model in one shot with the --model (-m) option — the generated repository imports the model and returns it from model():
The above commands create a Repositories directory inside the app directory.
Generated files
By default, make:repository UserRepository creates two files:
app/Repositories/UserRepository.php— the concrete classapp/Repositories/Contracts/UserRepositoryInterface.php— the paired interface (extendsRepositoryContract)
The concrete is declared implements UserRepositoryInterface, and the package's service provider auto-binds the interface to the concrete in the container — so you can type-hint the interface anywhere:
To skip the interface for a single command, pass --no-interface:
Configuration
Publish the config to customize behavior:
That creates config/repository.php:
Example output
A repository generated with --model=User looks like this:
All versions of laravel-make-repository with dependencies
illuminate/console Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^10.0 || ^11.0 || ^12.0 || ^13.0