src/Model.php
public static function findOrFail($id, array $columns = ['*'], $parent = null)
    {
        $model = static::find($id, $columns, ['parent' => $parent]);
        if (is_null($model)) {
            throw new ModelNotFoundException(get_called_class(), $id);
        }
        return $model;
    }
public static function findOrFail($id, array $columns = ['*'], $parent = null)
    {
        $model = static::find($id, $columns, ['parent' => $parent]);
        if (is_null($model)) {
            throw new ModelNotFoundException(get_called_class(), $id);
        }
        return $model;
    }
Find a model by its primary key or throw an exception.

@param mixed $id
@param array $columns
@param int $parent
@return static