Support the ongoing development of Laravel.io →
posted 10 years ago
IOC
Last updated 2 years ago.
0

What if you try Whatever::$dynamicProperty?

Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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 :)

Last updated 2 years ago.
0

use

MyFacade::getFacadeRoot()->myProperty
Last updated 2 years ago.
0

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
Last updated 2 years ago.
0

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.
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.