Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Make Repository Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v1.0.0

Added

  • Paired interface generation. 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.
  • Publishable config file at config/repository.php exposing path, namespace, with_interface, and bind. Publish with php artisan vendor:publish --tag=repository-config.
  • Auto-binding. When 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.
  • Support for Laravel 10, 11, 12, and 13.
  • PHP 8.1+ type declarations across all source files (typed properties, parameter and return types, 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.

Changed

  • BREAKING: Minimum PHP version is now 8.1 (was 5.4).
  • BREAKING: Minimum Laravel version is now 10.x.
  • BREAKING: BaseRepository::model() is now declared abstract public function model(): string — subclasses must declare the : string return type.
  • BREAKING: Removed GeneralException::render(), which depended on a non-existent withFlashDanger() helper. Implement rendering in your application's exception handler if needed.
  • Renamed src/repository/src/Repository/ and src/exceptions/src/Exceptions/ so PSR-4 autoloading works on case-sensitive filesystems (Linux CI).
  • Switched to a pure PSR-4 autoload — the legacy classmap entry is gone.
  • RepositoryServiceProvider now only registers the command when running in the console.
  • The generated make:repository stub now declares model(): string to match the abstract signature.

Fixed

  • BaseRepository::unsetClauses() now also resets orderBys, so an ordering clause from a previous call no longer leaks into the next query.
  • Removed the broken 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.

Removed

  • classmap autoload entry from composer.json.
  • GeneralException::render() method.
  • MakeRepository::alreadyExists() override.

[0.0.3] - earlier

Previous releases targeted Laravel 5 and above on PHP 5.4+. See git history for details.

0.0.2
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky