The throw_unless function throws the given exception if a given boolean expression evaluates to false:
<?php throw_unless(Auth::user()->isAdmin(), AuthorizationException::class);

throw_unless(
    Auth::user()->isAdmin(),
    AuthorizationException::class,
    'You are not allowed to access this page.'
);
<?php         preg_match('/(?:\n\s*|^\s*)<([a-zA-Z0-9\-]+)/', $html, $matches, PREG_OFFSET_CAPTURE);



        throw_unless(

            count($matches),

            new RootTagMissingFromViewException

        );



        $tagName = $matches[1][0];

        $lengthOfTagName = strlen($tagName);
<?php         collect($rules)

            ->keys()

            ->each(function($ruleKey) use ($data) {

                throw_unless(

                    array_key_exists(Utils::beforeFirstDot($ruleKey), $data),

                    new \Exception('No property found for validation: ['.$ruleKey.']')

                );

            });

    }
<?php     ) {}



    public static function getKey() {

        throw_unless(

            property_exists(static::class, 'key'),

            new \Exception('You need to define static $key property on: '.static::class)

        );



        return static::$key;

    }