src/Database/ORM/Traits/QueryBuilding.php
/**
	 * Gets a model instance by the primary key value. If not found, it raises an HttpResponseException with the
	 * provided code (or default 404).
	 *
	 * @param mixed $primaryKey
	 * @param int $code
	 * @return static
	 */
Gets a model instance by the primary key value. If not found, it raises an HttpResponseException with the
provided code (or default 404).

@param mixed $primaryKey
@param int $code
@return static
Gets a model instance by the primary key value . If not found it raises an HttpResponseException with the provided code ( or default 404 ) . @param mixed $primaryKey @param int $code @return static
public static function findOrFail($primaryKey, $code = 404) {
		$model = static::find($primaryKey);
		if (is_null($model)) {
			throw new HttpResponseException($code);
		}
		return $model;
	}
public static function findOrFail ( $ primaryKey , $ code = 404 ) { $ model = static :: find ( $ primaryKey ) ; if ( is_null ( $ model ) ) { throw new HttpResponseException ( $ code ) ; } return $ model ; }
Gets a model instance by the primary key value.
Gets a model instance by the primary key value .