jeudi 27 février 2020

Laravel Auth return different data

Sorry, anyone please help me. I use Laravel 5.4. I just wanna echo auth()-user()->role in view, but the result is different when I echo auth()->user()->role in controller. This is the code.

if(!empty(auth()->user())){
   echo auth()->user()->role;
}

result from controller

<li class="">
   <a href="#withdraw" data-toggle="tab" aria-expanded="false">
     <i class="material-icons">archive</i>
     Withdraw 
     <div class="ripple-container"></div>
   </a>
</li>

result from view

The correct data is 3. Does anyone know the problem? I've tried to clear cache, but no changes. Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire