<?php

namespace App\Traits;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

trait Uniqid
{

  protected static function uniqid($e){
    $model =  DB::table(app(self::class)->getTable())->orderBy('id','desc')->first();
    $id  = $model? $model->id : 0;
    $e.=date("y");
    return sprintf("%s%04d",$e,$id+1);
  }
}
