Download the PHP package anik/repository-generator without Composer
On this page you can find all versions of the php package anik/repository-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download anik/repository-generator
More information about anik/repository-generator
Files in anik/repository-generator
Package repository-generator
Short Description Repottern is a repository pattern for Laravel.
License MIT
Informations about the package repository-generator
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
Requirements:
- Laravel >= 5
- PHP >= 5.5
How to install?
composer require anik/repository-generator
- Add
Anik\Generator\Providers\RepositoryGeneratorServiceProvider::class
to the providers array in config/app.php - After the installation, run
php artisan vendor:publish
. This will copy the config file to Laravel's config directory namedgenerator.php
Configuration:
- namespace: The namespace you want to have for the class.
- dir: The path the file will be saved
- 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
- Class name: The class name you want as a repository. Must be a valid identifier.
- Optional arguments
- --dir=dir_name. if specified, the new class will be created on that directory.
- --namespace=namespace. if specified, then class will have that namespace.
- --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.
Example:
Note:
Here, the optional arguments can be used at any position
If the --dir argument is specified, then the directory will be created regarding the current path
License:
Repository Generator is released under the MIT Licence.
Bugs and Issues:
Well, I'll always appreciate if you find any bug or issue. Feel free to inform. Anyway, forks are welcomed too.