Get session ID and display details when logging in using Laravel 5.2
<p>I'm new to Laravel, using version 5.2. My login works well and redirects to dashboard page. I want to display some info in the dashboard page. I tried this code <code>auth()-&gt;user()-&gt;id</code> and this works well.</p>

<p>Here's my code below:</p>

<pre><code>&lt;?php

namespace App\Repositories;
use App\Repositories\Contracts\dashboardRepositoryInterface;
use Illuminate\Http\Request;
use DB;
use Session;
use Auth;


class dashboardRepository implements dashboardRepositoryInterface{

    protected $request;

    //Initialize request instance
    public function __construct(Request $request){
        $this-&gt;request = $request;

    }


    //getDashboard View
    public function getCreate(){

        $users = \App\Users::where('id', $this-&gt;request-&gt;session()-&gt;get('id'))-&gt;get(['id', 'first_name', 'last_name', 'email_address']);
        print_r($users); 
        return view('dashboard', 
        ['users' =&gt; $users]);
    }

}
</code></pre>

<p>I want that to display the information and it returns something like this when I <code>print_r</code> it out in <code>getCreate()</code> method:</p>

<pre><code>Illuminate\Database\Eloquent\Collection Object ( [items:protected] =&gt; Array ( ) ) 
</code></pre>

<p>Here's my Blade view:</p>

<pre><code> &lt;div class="col-md-12 "&gt;
            @if(Auth::check())
                &lt;h1&gt;Welcome {{ Auth::user()-&gt;first_name }}!&lt;/h1&gt;
            @endif
         &lt;/div&gt;
         &lt;div&gt;
            @foreach($users as $user)
            &lt;p&gt;Your Profile Info: &lt;/p&gt;
            &lt;p&gt;First Name:  {{ $user-&gt;first_name}}&lt;/p&gt;
            &lt;p&gt;Last Name: {{ $user-&gt;last_name }}&lt;/p&gt;
            &lt;p&gt;Email: {{ $user-&gt;email_address }}&lt;/p&gt;
            @endforeach
         &lt;/div&gt;
</code></pre>