komicho/laravel-iid

There is no license information available for the latest version (dev-master) of this package.

Build a separate disambiguation for specific categories (IID) - Laravel

dev-master 2019-12-25 10:18 UTC

This package is not auto-updated.

Last update: 2024-11-21 09:52:21 UTC


README

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();
    }

    ...

}