<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Str;
class Driver extends Model
{
use HasFactory;
use SoftDeletes;
protected $guarded = [];
protected static function boot() {
parent::boot();
static::creating(function ($model) {
if ( ! $model->getKey()) {
$model->{$model->getKeyName()} = (string) Str::uuid();
}
});
}
/**
* Get the value indicating whether the IDs are incrementing.
*
* @return bool
*/
public function getIncrementing()
{
return false;
}
/**
* Get the auto-incrementing key type.
*
* @return string
*/
public function getKeyType()
{
return 'string';
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]