Last active
January 11, 2023 13:54
-
-
Save elishaukpong/e57cbb8554f5ab5d8dd3917c190769fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
/** | |
* Handle dynamic, static calls to the object. | |
* | |
* @param string $method | |
* @param array $args | |
* @return mixed | |
* | |
* @throws \RuntimeException | |
*/ | |
public static function __callStatic($method, $args) | |
{ | |
$instance = static::getFacadeRoot(); | |
if (! $instance) { | |
throw new RuntimeException('A facade root has not been set.'); | |
} | |
return $instance->$method(...$args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment