Looking to hire Laravel developers? Try LaraJobs

laravel-iid maintained by komicho

Description
Build a separate disambiguation for specific categories (IID) - Laravel
Author
Last update
2019/12/25 11:18 (dev-master)
Downloads
78
Tags

Comments
comments powered by Disqus

komicho\laraveliid

Build a separate disambiguation for specific categories (IID) . wikipedia

use

use Komicho\Laravel\Traits\LaravelIid;

functions

create

Model::create($data);

variables

$guideColumn

protected $guideColumn = '<column_name>';

Type the name of the column through which the group sequence is selected.

database > migrations

add column

You must add this column.

...

$table->integer('iid')->nullable();

...

Full example:-

Specify a sequence for each project.

Model :-

<?php

use Komicho\Laravel\Traits\LaravelIid;

class Backlog extends Model
{
    use LaravelIid;

    protected $guideColumn = 'project_id';
    
    ...
}

Controller :-

<?php

namespace App\Http\Controllers;

use App\Backlog;

use Illuminate\Http\Request;

class BacklogController extends Controller
{

    ...

    public function store(Request $request)
    {
        Backlog::create($request->all());
        return back();
    }

    ...

}