/** * Create a new Eloquent model instance. * * @param array $attributes * * @throws LackOfCoffeeException */ public function __construct(array $attributes = []) { parent::__construct($attributes); if (!array_key_exists(static::class, static::$registered)) { throw new LackOfCoffeeException(vsprintf('You forgot to call registerEvents() on %s.' . ' The method should be called on a Service Provider.' . ' See http://laravel.com/docs/5.1/eloquent#events' . ' for more details.', [static::class])); } }