X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/024924eef38179ecb12ef5cd6d7bcdcb8c15a298..refs/pull/3391/head:/app/Entities/Models/Entity.php diff --git a/app/Entities/Models/Entity.php b/app/Entities/Models/Entity.php index 0eb402284..7ad78f1d1 100644 --- a/app/Entities/Models/Entity.php +++ b/app/Entities/Models/Entity.php @@ -14,6 +14,7 @@ use BookStack\Entities\Tools\SlugGenerator; use BookStack\Facades\Permissions; use BookStack\Interfaces\Deletable; use BookStack\Interfaces\Favouritable; +use BookStack\Interfaces\Loggable; use BookStack\Interfaces\Sluggable; use BookStack\Interfaces\Viewable; use BookStack\Model; @@ -35,6 +36,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property string $slug * @property Carbon $created_at * @property Carbon $updated_at + * @property Carbon $deleted_at * @property int $created_by * @property int $updated_by * @property bool $restricted @@ -45,7 +47,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static Builder withLastView() * @method static Builder withViewCount() */ -abstract class Entity extends Model implements Sluggable, Favouritable, Viewable, Deletable +abstract class Entity extends Model implements Sluggable, Favouritable, Viewable, Deletable, Loggable { use SoftDeletes; use HasCreatorAndUpdater; @@ -321,4 +323,12 @@ abstract class Entity extends Model implements Sluggable, Favouritable, Viewable ->where('user_id', '=', user()->id) ->exists(); } + + /** + * {@inheritdoc} + */ + public function logDescriptor(): string + { + return "({$this->id}) {$this->name}"; + } }