What if you try Whatever::$dynamicProperty
?
No it's not. It should not be necessary as classes should not be using public properties anyway - some classes have an instance() method that allows you to get the instance from the facade if you need to, so Request::instance()->server
works.
Marwelln said:
What if you try
Whatever::$dynamicProperty
?
Yeah, you're right, however it's how anlutro wrote: it's not possible since it throws Access to undeclared static property
Thank you for your help :)
How did you define the facade class and reference by the app::bind method?
Did you link your facade alias with your class in your start file?
The solution that younes0 gives you go well but why you cannot access using?
MyFacade::myProperty
Could you show the source of your facade and the accessor? Facades should literally be a pass through, a way of statically accessing instances of a class.
Auth::check(); // statically accessed but is actually called check() on an instance of Guard.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community