Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/astra.aplikasipos.info/laravel_backend/app/Models/
Upload File :
Current File : /home/aplikasiposinfo/www/astra.aplikasipos.info/laravel_backend/app/Models/Barang.php

<?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 Barang 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]