29 lines
556 B
PHP
29 lines
556 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Spatie\Translatable\HasTranslations;
|
|
|
|
class Category extends Model
|
|
{
|
|
use HasFactory;
|
|
use HasTranslations;
|
|
|
|
protected $guarded = ['id'];
|
|
public $translatable = ['title'];
|
|
|
|
protected static function booted()
|
|
{
|
|
static::deleting(function ($group) {
|
|
$group->exports()->delete();
|
|
});
|
|
}
|
|
|
|
public function exports()
|
|
{
|
|
return $this->hasMany(Export::class);
|
|
}
|
|
}
|