PhyrePanel/web/app/Models/Customer.php
Bozhidar Slaveykov 23a68e300e update
2024-04-04 16:05:48 +03:00

41 lines
768 B
PHP

<?php
namespace App\Models;
use App\Events\ModelCustomerCreated;
use App\Events\ModelCustomerDeleting;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class Customer extends Model
{
use HasFactory;
protected $fillable = [
'name',
'email',
'phone',
'address',
'city',
'state',
'zip',
'country',
'company',
];
public static function boot()
{
parent::boot();
static::created(function ($model) {
event(new ModelCustomerCreated($model));
});
static::deleting(function ($model) {
event(new ModelCustomerDeleting($model));
});
}
}