Skip to content

jeylabs/laravel-code-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code Generator for Laravel

Installation

You can install the package via composer:

composer require jeylabs/laravel-code-generator

Usage

<?php

namespace App;

use Jeylabs\CodeGenerator\Traits\Code;
use Illuminate\Database\Eloquent\Model;

class Product extends Model
{
    use Code;

    static $codePrefix = 'PRO';
}

Example : PRO0000001

If you want to customize your code column

static $codeColumn = 'code';

If you want to set the prefix base on conditions

static $codePrefix = [
        "RM" => [
            'column' => 'type',
            'value' => 'Raw Materials'
        ],
        "FG" => [
            'column' => 'type',
            'value' => 'Finished Goods'
        ]
    ];

About

Code Generator for Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages