code: public static function firstOrFail($query = [])
      {
          $model = static::first($query);
          if (is_null($model)) {
              throw new ModelNotFoundException(get_called_class());
          }
          return $model;
      }
docs: Execute the query and get the first result or throw an exception.
  
  @param QueryBuilder|array $query
  @throws ModelNotFoundException
  @return static