mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Fixed asset model deletable check
This commit is contained in:
@@ -234,7 +234,7 @@ class AssetModel extends SnipeModel
|
||||
public function isDeletable()
|
||||
{
|
||||
return Gate::allows('delete', $this)
|
||||
&& ($this->assets_count == 0)
|
||||
&& (($this->assets_count ?? $this->assets()->count()) === 0)
|
||||
&& ($this->deleted_at == '');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user