Zizaco / confide

Confide is a authentication solution for Laravel 4
1.19k stars 258 forks source link

Display username in View #335

Closed LeoFNaN closed 10 years ago

LeoFNaN commented 10 years ago

Hello,

I'm new to Laravel and I hove Confide setup and running as well as a few blade templates and everything is working fine (I can login, signup, reset).

My issue is probably simple, I'm trying to display the username after a successful login that redirects to a dashboard view I created. I tried {{{ $username or 'No Name'}}} in my blade file but it displays No Name. I have tried {{ Session::get(username) }} and it echos out a 1. I tried to instantiate a new $user = new User and pass it using ->with('user', $user) in UsersController but to no avail, How do I setup and pass data to the view?

Thank you

Zizaco commented 10 years ago

Hi

Try:

{{ Confide::user()->username }}

(: