How to display encrypted id in view?

Posted 9 months ago by anonymouse703

Hello, How to display encrypted session id in Laravel view?

This is my controller:

public function index()
    {

        $users = Session::whereNotNull('user_id')->get();
   

        return view('pages.admin.system.connection-monitoring.index', compact('users'));
    }

when you dd ($users) - it will give you all the keys and the data. So i checked the key(id) and it was encrypted but when i display it in view it was decrypted.

@foreach($users as $user)
    <td>{{$user->id}}</td>
@endforeach 

the display will be 1. What I want is the encrypted one "8kadsha29789ae".

So, is there a way to display the encrypted one?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.