Skip to content

A simple package for adding make:repository command to Laravel 5+

License

Notifications You must be signed in to change notification settings

blackkat98/laravel-make-repository

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads Latest Unstable Version License

Laravel 5+ Php Artisan Make:Repository

A simple package for addding php artisan make:repository command to Laravel 5+

Installation

Require the package with composer using the following command:

composer require jason-guru/laravel-make-repository --dev

Or add the following to your composer.json's require-dev section and composer update

"require-dev": {
          "jason-guru/laravel-make-repository": "^0.0.1"
}

Usage

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.

Once the repository is generated add your model class and return it in the model function,

Example:

<?php

namespace DummyNamespace;

use JasonGuru\LaravelMakeRepository\Repository\BaseRepository;
//use Your Model

/**
 * Class DummyClass.
 */
class DummyClass extends BaseRepository
{
    /**
     * @return string
     *  Return the model
     */
    public function model()
    {
        //return YourModel::class
    }
}

About

A simple package for adding make:repository command to Laravel 5+

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%