2017 © Pedro Peláez
 

library repository-generator

Repository generator generates repository classes as it requires for repottern package.

image

anik/repository-generator

Repository generator generates repository classes as it requires for repottern package.

  • Saturday, July 9, 2016
  • by ssi-anik
  • Repository
  • 0 Watchers
  • 2 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Repository generator is a PHP class generator for the Repository pattern - Repottern

Repository generator generates the Repository class that's how it's required for the Repottern. Have a look at repottern, (*1)

Requirements:

  • Laravel >= 5
  • PHP >= 5.5

How to install?

  1. composer require anik/repository-generator
  2. Add Anik\Generator\Providers\RepositoryGeneratorServiceProvider::class to the providers array in config/app.php
  3. After the installation, run php artisan vendor:publish. This will copy the config file to Laravel's config directory named generator.php

Configuration:

  1. namespace: The namespace you want to have for the class.
  2. dir: The path the file will be saved
  3. model_namespace: The model namespace, if you want to return from the class on the fly. Don't append any slash.

Usages:

The artisan console has one mandatory argument and 3 optional arguments. * Mandatory argument 1. Class name: The class name you want as a repository. Must be a valid identifier. * Optional arguments 1. --dir=dir_name. if specified, the new class will be created on that directory. 2. --namespace=namespace. if specified, then class will have that namespace. 3. --model=model. if specified, will lookup using the config file's model_namespace. If found, then will be returned from the implemented model() method. Otherwise, will be left blank., (*2)

Example:

php artisan make:repository UserRepository
php artisan make:repository UserRepository --namespace=Repository
php artisan make:repository UserRepository --model=User
php artisan make:repository UserRepository --namespace=Repository --model=User

Note:

Here, the optional arguments can be used at any position, (*3)

If the --dir argument is specified, then the directory will be created regarding the current path, (*4)

License:

Repository Generator is released under the MIT Licence., (*5)

Bugs and Issues:

Well, I'll always appreciate if you find any bug or issue. Feel free to inform. Anyway, forks are welcomed too., (*6)

The Versions

09/07 2016

dev-master

9999999-dev

Repository generator generates repository classes as it requires for repottern package.

  Sources   Download

MIT

The Requires

 

by Avatar ssi-anik

07/07 2016

1.0.0

1.0.0.0

Repottern is a repository pattern for Laravel.

  Sources   Download

MIT

The Requires

 

by Avatar ssi-anik