Disable plugins that have errors (#14383)

* Disable plugins that have errors
Disable plugin if a hook throws an error and set a notification
Move notification code to class, so we can access it
Clear notification when plugin is attempted to be enabled again

* fix style and lint fixes

* another lint fix and handle if property is missing
This commit is contained in:
Tony Murray
2022-09-25 22:47:58 -05:00
committed by GitHub
parent 333ba7c2cd
commit e990dfcb35
9 changed files with 222 additions and 197 deletions
+18
View File
@@ -28,6 +28,24 @@ class Notification extends Model
* @var string
*/
protected $primaryKey = 'notifications_id';
protected $fillable = [
'title',
'body',
'severity',
'source',
'checksum',
'datetime',
];
public static function boot()
{
parent::boot();
// delete attribs for this notification
static::deleting(function (Notification $notification) {
$notification->attribs()->delete();
});
}
// ---- Helper Functions ----