1
I have a $user variable in my Controller. So:
public function index()
{
$userBiografia = "Biografia do Usuário";
return view('user.index', compact('userBiografia'));
}
I can print it peacefully in the "user.index" View using:
{{ $userBiografia }}
So far ok!
The great PROBLEM is: I cannot use this variable within my components. My component structure is like this:
{{ $userBiografia }} //Aqui estou imprimindo na View, ok, mas não é aqui que quero fazer isso.
<div class="profile-sidebar pd-lg-r-25">
<div class="row">
@component('user.components.sidebar_left.index')
@endcomponent
</div><!-- row -->
</div><!-- profile-sidebar -->
and within this component I call a new component which is where in fact the variable will be printed.
Anyone who can help I really appreciate it, because I haven’t found anything about it.
Thank you!!!
I ended up putting everything in this format: "<x-userSidebarLeftWidgetBiografia />", then created a View, in App, by Artisan himself. There I am doing all the data processing. I liked it because the code on the blade is clean. I don’t know if I could understand kkk but the video was this link
– Jhow Santana
Ahhh yes, thank you Barttolo!
– Jhow Santana