Weave 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

Repoist Laravel Package

ozankurt/repoist

Repoist is a Laravel package that simplifies the repository pattern. It provides Artisan commands to generate repository classes and interfaces for Eloquent models, helping organize database queries, keep controllers lean, and make data access easier to test and maintain.

View on GitHub
Deep Wiki
Context7

Laravel 5 repository generator.

Frequently asked questions about Repoist
What is Repoist and what does it do in a Laravel app?
Repoist is a Laravel 5 package that scaffolds repository classes and interfaces for Eloquent models. It adds Artisan commands such as make:repository that generate plain PHP files under app/Repositories. The goal is to move database queries out of controllers and into dedicated classes that are easier to test and maintain. It is a dev-time scaffolding tool, not a runtime dependency.
Does Repoist support Laravel 8, 9, 10, or 11?
No. Repoist is explicitly scoped to Laravel 5 and its last release was in September 2019, so its illuminate/support constraint and PHP 7-era codebase will almost certainly fail Composer resolution on Laravel 8 and newer. For modern Laravel versions, treat the GitHub repository as a reference implementation and copy the stub templates into your project instead of installing the package.
How do I install Repoist in a Laravel 5 project?
Install it as a dev dependency with composer require --dev ozankurt/repoist, then register the service provider through auto-discovery or manually in config/app.php if your Laravel 5 version does not support discovery. After that you can run php artisan make:repository to generate a repository class and interface for an Eloquent model. Because the generated files are plain PHP you own, the package can be removed after scaffolding.
Does Repoist work with PHP 8?
Most likely not. Repoist was released in 2019 and targets the PHP 7.x era, and its Composer constraints and any transitive dev dependencies may not resolve on PHP 8.x. If you are running a modern PHP version, avoid installing the package and instead extract the generator stubs into your own codebase. That approach works unchanged on PHP 8 and Laravel 11.
How do I bind Repoist-generated repository interfaces in Laravel's container?
Repoist generates interfaces but does not automatically bind them to their implementations, so you need an explicit service provider such as RepositoryServiceProvider that maps each FooRepositoryInterface to FooRepository. Keep the bindings small and explicit rather than using auto-binding magic, so container resolution failures surface at boot or in tests instead of at runtime. Without a binding, injecting the interface will throw a resolution error that can look like a framework bug.
Is the repository pattern worth using over plain Eloquent in Laravel?
It depends on why you want the abstraction. Laravel's active-record Eloquent models already provide query building and testing support, so repositories often become thin pass-through wrappers that add indirection without improving testability. The pattern is justified when you need swappable persistence or contract-based testing; if the goal is simply leaner controllers, an Actions or Services layer is usually a better and cheaper fit.
Can I use Repoist stubs with Laravel 11 without installing the package?
Yes. The recommended path is to read the generators in the Repoist repository and copy the stub templates, such as repository.stub and repository-interface.stub, into your host project. You can either write a small in-house make:repository command using Illuminate\Console\GeneratorCommand or document the two-file pattern as a team convention. This gives you the same ergonomics with no abandoned dependency and works on Laravel 11.
How should I test repositories generated by Repoist?
Because generated repositories are ordinary PHP classes that wrap Eloquent, you can test them with Laravel's normal database testing tools, using SQLite in memory or transactions to keep tests fast. If you inject the repository interface into controllers or services, you can also swap in a fake implementation for unit tests. The main thing to verify is that every interface has a container binding, otherwise tests will fail during resolution rather than in the logic under test.
Is Repoist still maintained?
No. Repoist has a single maintainer, around 92 GitHub stars, and no release since September 2019, so there is no active security response path. The package is MIT licensed, which means you can fork it or copy its stubs freely if you need to keep using the approach. For most teams, extracting the stubs is lower risk than depending on an unmaintained package.
What are the alternatives to Repoist for repository generation in Laravel?
The closest alternative is to copy the Repoist stubs into your project and add a small custom Artisan generator. If your real goal is cleaner controllers rather than swappable persistence, an Actions or Services layer is often a better fit. For teams that have formally adopted the repository pattern, a hand-written RepositoryServiceProvider plus team conventions gives you explicit, maintainable bindings without relying on an abandoned package.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections