且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel中的双冒号是什么意思

更新时间:2022-05-13 03:25:56

::范围解析运算符

这称为scope resolution operator.该运算符用于引用某些块或程序上下文的范围,例如类,对象,名称空间等.为此引用,标识符与该运算符一起使用,以访问或再现该范围内的代码.

This is called as scope resolution operator. This operator is used to refer the scope of some block or program context like classes, objects, namespace and etc. For this reference an identifier is used with this operator to access or reproduce the code inside that scope.

参考

Auth::guard($guard)->guest():在这一行中,您使用静态类Auth guard()方法.要使用静态类的功能,请使用::范围解析运算符.

Auth::guard($guard)->guest() : In this line you are using the guard() method of static class Auth. To use the function of a static class we use :: Scope Resolution Operator.