When I read code written in the Laravel framework, I see a lot of uses of ClassName::class. What does is the meaning of the modifier ::class? Is th
Since PHP 5.5, the class keyword is also used for class name resolution. You can get a string containing the fully qualified name of the ClassName class by using
ClassName::class. This is particularly useful with namespaced classes.
For example
namespace MyProject;
class Alpha{ }
namespace MyOtherProject;
class Beta{ }
echo Alpha::class; // displays: MyProject\Alpha
echo Beta::class; // displays: MyOtherProject\Beta