some work on models
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\NotificationContext;
|
||||
use App\Models\Concerns\Reportable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
@@ -9,6 +11,19 @@ use Illuminate\Database\Eloquent\Model;
|
||||
*/
|
||||
class Table extends Model
|
||||
{
|
||||
use Reportable;
|
||||
use NotificationContext;
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::deleting(function(Table $self) {
|
||||
// update refcounts
|
||||
$self->revisions()->decrement('refs');
|
||||
});
|
||||
}
|
||||
|
||||
/** Owning user */
|
||||
public function owner()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user