Skip to content

Laravel Service Repository Generator is a Package for Generating Service and Repository Class with Implementing an Interface

License

Notifications You must be signed in to change notification settings

ferdinalaxewall/service-repository-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Service Repository Generator

Laravel Service Repository Generator is a Package for Generating Service and Repository Class based on Model or custom name

Latest Stable Version Total Downloads Daily Downloads License

Installation Guide

composer require ferdinalaxewall/service-repository-generator

Go to config/app.php, then put these code on service providers

'providers' => [
    /*
    * Package Service Providers...
    */
    \Ferdinalaxewall\ServiceRepositoryGenerator\ServiceRepositoryGeneratorProvider::class,
],

Last, for make sure this package installed correctly.

composer dump-autoload && php artisan optimize:clear

Default Service Repository Directory Structure Based

├── app
|   ├── Services          
|   |    ├── Entity          
|   |    |   ├── EntityService.php
|   |    |   ├── EntityServiceImp.php
|   ├── Repositories          
|   |    ├── Entity          
|   |    |   ├── EntityRepository.php
|   |    |   ├── EntityRepositoryImp.php 
|   |    └── BaseRepository.php

Usage Guide

Generate Service Repository Class with Interface

Generate Service and Repository Class with construct the Model and Create Base Repository Class

php artisan make:service-repository {model}

Generate Service Only Class with Interface

Generate Service Class

php artisan make:service {service-name}

Generate Repository Only Class with Interface

  • Generate Repository Class with construct the Model and Create Base Repository Class
php artisan make:repository {repository-name} {--model=}

OR

  • Generate Repository Class without construct the Model
php artisan make:repository {repository-name}

Features

  • Generate Service and Repository Class with Implement Interface
  • Generate Only Service Class with Implement Interface
  • Generate Only Repository Class with Implement Interface
  • Automaticaly Generate Base Repository Class
  • Support Nesting Service, Repository Classpath (e.g. Master/User, Master/User/Employee, etc)
  • Automaticaly Generate Model (If the model didn't exists) when Create Repository Class
  • Automaticaly Class and Interface Binding (Only File inside Services or Repositories Directory)

Contributors

License

This project is released under the MIT license.

About

Laravel Service Repository Generator is a Package for Generating Service and Repository Class with Implementing an Interface

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages