some work on models

This commit is contained in:
2018-07-14 14:34:17 +02:00
parent 6fd1d7eb89
commit 7493d3e176
7 changed files with 138 additions and 0 deletions
+15
View File
@@ -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()
{