ldc-legaulois/app/Models/MomentStrates.php

27 lines
541 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MomentStrates extends Model
{
2021-03-20 14:38:15 +01:00
protected $table = "moment_strates";
2021-05-05 15:13:33 +02:00
protected static function booted()
{
static::creating(function ($strate) {
$strate->content = clean($strate->content);
});
static::updating(function ($strate) {
$strate->content = clean($strate->content);
});
}
2021-03-20 14:38:15 +01:00
public function moment()
{
return $this->belongsTo('App\Models\Moments', 'moment_id');
}
}