How to display encrypted id in view?

Posted 3 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.