public static function firstOrFail($query = []) { $model = static::first($query); if (is_null($model)) { throw new ModelNotFoundException(get_called_class()); } return $model; }