84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
Static call in larave project
facade
The title method in the Admin class is non-static
How is this achieved?
人生最曼妙的风景,竟是内心的淡定与从容!
In the final analysis, it is achieved through themagic method __callStatic
magic method __callStatic
IlluminateSupportFacadesFacadeCode at the bottom
IlluminateSupportFacadesFacade
https://github.com/illuminate...
/** * 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); }
AboutFacadeis one of the more important features ofLavavel. You can learn more about its implementation.
Facade
Lavavel
In the final analysis, it is achieved through the
magic method __callStatic
IlluminateSupportFacadesFacade
Code at the bottomhttps://github.com/illuminate...
About
Facade
is one of the more important features ofLavavel
. You can learn more about its implementation.