for some reason after upgrading to Laravel 5.7 grom 5.6 i cant register Observers like this anymore:
class Partner extends Model
{
/**
* disabled searchable trait, because there is no elastic search cluster available yet.
*/
use Searchable;
use ObservantTrait;
public static function boot()
{
static::observe(new PartnerObserver());
parent::boot();
}
I get a Fatal Error saying that there is an Undefined Error:
/www/my-project/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
protected function initializeTraits()
{
foreach (static::$traitInitializers[static::class] as $method) {
$this->{$method}();
}
}