mirror of
https://github.com/wearepixel/laravel-comments.git
synced 2026-11-14 14:02:04 +00:00
23 lines
399 B
PHP
23 lines
399 B
PHP
<?php
|
|
|
|
namespace BeyondCode\Comments\Tests\Models;
|
|
|
|
use BeyondCode\Comments\Traits\HasComments;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Post extends Model
|
|
{
|
|
use HasComments;
|
|
|
|
protected $guarded = [];
|
|
|
|
public static function boot(): void
|
|
{
|
|
parent::boot();
|
|
|
|
static::deleting(function (self $model) {
|
|
$model->comments()->delete();
|
|
});
|
|
}
|
|
}
|