From b80b91514de26fbe837f94614c6d1a6a6f054f44 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 5 Sep 2018 19:27:37 -0700 Subject: [PATCH] Fixed Laravel 5.7 compatibility issue re: boot() method This was causing the error: Undefined index: App\Models\CustomField (View: /Users/snipe/Sites/snipe-it/snipe-it/resources/views/hardware/index.blade.php) and pointed to the Eloquent model library method: ``` protected function initializeTraits() { foreach (static::$traitInitializers[static::class] as $method) { $this->{$method}(); } } ``` Thanks to https://github.com/laravel/framework/issues/25455 for the clue. --- app/Models/CustomField.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Models/CustomField.php b/app/Models/CustomField.php index eef6a55d9a..390c6500b8 100644 --- a/app/Models/CustomField.php +++ b/app/Models/CustomField.php @@ -87,6 +87,7 @@ class CustomField extends Model */ public static function boot() { + parent::boot(); self::created(function ($custom_field) { // Column already exists on the assets table - nothing to do here.