mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
39 lines
714 B
PHP
39 lines
714 B
PHP
<?php
|
|
|
|
namespace App\Models\Oasis;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Str;
|
|
|
|
class Client extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public $guarded = ['id'];
|
|
|
|
public $incrementing = false;
|
|
|
|
protected $keyType = 'string';
|
|
|
|
public function user()
|
|
{
|
|
return $this->hasOne(User::class, 'id', 'user_id');
|
|
}
|
|
|
|
public function invoices()
|
|
{
|
|
return $this->hasMany(Invoice::class, 'client_id', 'id');
|
|
}
|
|
|
|
protected static function boot()
|
|
{
|
|
parent::boot();
|
|
|
|
static::creating(function ($order) {
|
|
$order->id = Str::uuid();
|
|
});
|
|
}
|
|
}
|