views are not suppose to be cluttered with php code
however to solve this, what you can do is define an alias in the config/app.php, add a new line in the aliases array
'Xclass' => Anamespace\Bnamespace\Xclass::class,
then you should be able to use Xclass in the view directly
Thanks.
Is there a common approach for this case? Maybe it is better to create global helper function?
depends on what you're doing.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community