Isswp101\Persimmon\Model::findOrFail PHP Méthode

findOrFail() public static méthode

Find a model by its primary key or throw an exception.
public static findOrFail ( mixed $id, array $columns = ['*'], integer $parent = null ) : static
$id mixed
$columns array
$parent integer
Résultat static
    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;
    }