Skip to content

This is a package to auto generate repositories, services, interface.

License

Notifications You must be signed in to change notification settings

Udemy-FPT/design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns

This is a package to auto generate repositories, services, interface.


## Artisan Command List

Make Repository

Create a repository Class.
php artisan make:repository your-repository-name

Example:

php artisan make:repository UserRepository

or

php artisan make:repository Backend/UserRepository

The above will create a Repositories directory inside the App directory.

Create a repository with Interface.
php artisan make:repository your-repository-name -i

Example:

php artisan make:repository UserRepository -i

or

php artisan make:repository Backend/UserRepository -i

Here you need to put extra -i flag. The above will create a Repositories and Interfaces in Repositories folder
directory inside the App directory.


Make Service

Create a Service Class.
php artisan make:service your-service-name

Example:

php artisan make:service UserService

or

php artisan make:service Backend/UserService

The above will create a Services directory inside the App directory.

Make Trait

Create a Trait.
php artisan make:trait your-trait-name

Example:

php artisan make:trait CheckAuth

or

php artisan make:trait Backend/CheckAuth

Publish Repository

Publish Base Repository.
php artisan vender:publish

All function in base repository

public function find(array $conditions = []);
public function findOne(array $conditions);
public function findById(int $id);
public function create(array $attributes);
public function update(Model $model, array $attributes = []);
public function save(Model $model);
public function delete(Model $model);
public function get($query);
public function destroy(array $ids);
public function findCount(array $conditions);
public function toBase($query);
public function updateMultiple(Builder $query, array $attributes = []);
public function updateOrCreate(array $attributes, array $values);
public function findAll();
public function findByIds(array $ids);
public function model();
public function makeModel();
public function resetModel();

License

The MIT License (MIT). Please see License File for more information.

About

This is a package to auto generate repositories, services, interface.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages