I'm trying to use class_alias on a facade \Facades\Security.
I tried this:
class_alias("\\Facades\\Security", "Security");
echo Security::Unique();
But i got an error (Class 'Security' not found in...).
The weird thing is that when i try this:
$facade = "Security";
class_alias("\\Facades\\" . $facade, $facade);
echo $facade::Unique();
It does work and i get an output from the function 'Unique'. So somehow storing the name of the facade in a variable and accessing it from there, fixes the problem...
Can someone tell me why?
Thanks :)