jason-guru/laravel-make-repository
Laravel package adding Artisan “make:repository” scaffolding for the repository pattern. Quickly generate repository interfaces and implementations, keeping controllers slimmer and data access consistent and testable. Easy to install and customize for your app structure.
php artisan make:repository UserRepository now also creates App\Repositories\Contracts\UserRepositoryInterface (extending RepositoryContract) and the concrete class is declared implements UserRepositoryInterface. Pass --no-interface to skip.config/repository.php exposing path, namespace, with_interface, and bind. Publish with php artisan vendor:publish --tag=repository-config.repository.bind is true (default), the service provider scans the configured Contracts directory on boot and binds each *Interface to its matching concrete class, so type-hinting the interface anywhere (controllers, jobs, etc.) resolves the repository.--model (-m) option on make:repository. Example: php artisan make:repository UserRepository --model=User generates a repository with use App\Models\User; and return User::class; already wired up.static return types, int|string IDs, mixed).declare(strict_types=1) in every PHP file.orchestra/testbench test suite with 22 tests / 42 assertions covering the make:repository command, stub generation, duplicate detection, and BaseRepository CRUD, query chain (where, whereIn, orderBy, limit), pagination, eager loading, and error paths.phpunit.xml.dist with in-memory SQLite database for fast, isolated test runs.autoload-dev PSR-4 mapping for tests/..gitignore for vendor/, composer.lock, and the phpunit cache.composer test script alias for vendor/bin/phpunit.BaseRepository::model() is now declared abstract public function model(): string — subclasses must declare the : string return type.GeneralException::render(), which depended on a non-existent withFlashDanger() helper. Implement rendering in your application's exception handler if needed.src/repository/ → src/Repository/ and src/exceptions/ → src/Exceptions/ so PSR-4 autoloading works on case-sensitive filesystems (Linux CI).classmap entry is gone.RepositoryServiceProvider now only registers the command when running in the console.make:repository stub now declares model(): string to match the abstract signature.BaseRepository::unsetClauses() now also resets orderBys, so an ordering clause from a previous call no longer leaks into the next query.MakeRepository::alreadyExists() override — it called class_exists() on the unqualified raw name (e.g. "UserRepository"), which never matched. Laravel's default file-existence check is correct and is now used.classmap autoload entry from composer.json.GeneralException::render() method.MakeRepository::alreadyExists() override.Previous releases targeted Laravel 5 and above on PHP 5.4+. See git history for details.
How can I help you explore Laravel packages today?