Download the PHP package ozankurt/repoist without Composer
On this page you can find all versions of the php package ozankurt/repoist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ozankurt/repoist
More information about ozankurt/repoist
Files in ozankurt/repoist
Informations about the package repoist
Repoist
Laravel repository generator for 5.2+ versions
Usage
Step 1: Install Through Composer
Step 2: Publish and edit the configurations
In Laravel: Run php artisan vendor:publish --tag=repoist-config
from the console to configure the Repoist according to your needs.
Step 3: Run Artisan!
You're all set. Run php artisan
from the console, and you'll see the new commands.
For Lumen
In bootstrap\app.php
enable Facades and Eloquent, also enable the configuration file.
In the Register service providers section add:
Examples
- Repository
- Criterion
Repository
Will output:
app/Contracts/Task/TaskRepository.php
(contract)app/Repositories/Eloquent/EloquentTaskRepository.php
app/Task.php
(if needed)
Criterion
Will output:
app/Repositories/Eloquent/Criteria/Completed.php
Configurations
If somehow you cannot publish the config/repoist.php
from artisan here you can copy and use it.
Configurations
Default methods of the Kurt\Repoist\Repositories\Eloquent\AbstractRepository
.
Method | Usage |
---|---|
all | $repo->all() |
find | $repo->find($id); |
findWhere | $repo->findWhere($column, $value); |
findWhereFirst | $repo->findWhereFirst($column, $value); |
findWhereLike | $repo->findWhereLike($column, $value, $paginate = 0); |
paginate | $repo->paginate($perPage = 10); |
create | $repo->create(array $properties); |
update | $repo->update($id, array $properties); |
delete | $repo->delete($id); |
Example Usage
Customer.php
EloquentCustomerRepository.php
PagesController.php