2017 © Pedro Peláez
 

library modelrepositorygenerator

A laravel package which generates a model, repository and contract

image

georgehanson/modelrepositorygenerator

A laravel package which generates a model, repository and contract

  • Tuesday, October 17, 2017
  • by GeorgeHanson
  • Repository
  • 0 Watchers
  • 1 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Model Repository Generator

This package is archived, (*1)

This is a package for Laravel 5 which allows you to easily generate repositories, contracts and models. It brings two new automatic file creation commands (Repositories and Contracts), as well as enhancing the current model creation command., (*2)

Installation

Once you have downloaded this package, you simply need to add the service provider to your config/app.php file. You should add the following service provider:, (*3)

[
    ...
    GeorgeHanson\ModelRepositoryGenerator\ModelRepositoryGeneratorServiceProvider::class
    ...
]

Once you have added the package to your service provider, be sure to run php artisan vendor:publish to publish the config file. Once this is done you can use this config file to change where you would like your models, repositories and contracts to be stored. You do not need to include your main applications namespace., (*4)

Generating Contracts

Generating contracts is simple and easy. Simply run the following command: php artisan generate:contract ContractName. Here you can set the contract name to whatever you would like., (*5)

Generating Repositories

To generate a repository simply run the following command: php artisan generate:repository Repository Model. As you can see the first argument this command takes the name of the repository and the second is the name of the model this repository is for. This will also generate a contract for the repository and implement that contract on the newly created repository., (*6)

Enhanced Model Generation

This package enhances the default model creation command which comes by default with Laravel. To generate a model you can simply run the following command: php artisan generate:model Model, replacing "Model" with the name of your choice. Not only will this create a model, it will also create a contract for this model and make the model implement the newly created contract., (*7)

You can also automatically generate a repository by passing the -R flag. For example, php artisan generate:model Model -R. This will generate a model, a contract for that model, a repository for that model and a contract for the repository., (*8)

You can also pass through the default flags which come out of the box with laravel such as -m to create a migration or -c to create a controller., (*9)

The Versions

17/10 2017

dev-master

9999999-dev

A laravel package which generates a model, repository and contract

  Sources   Download

The Requires

 

The Development Requires

by George Hanson

08/03 2017

dev-develop

dev-develop

A laravel package which generates a model, repository and contract

  Sources   Download

The Requires

 

The Development Requires

by George Hanson

08/03 2017

v0.1.0

0.1.0.0

A laravel package which generates a model, repository and contract

  Sources   Download

The Requires

 

The Development Requires

by George Hanson