Authentication Quickstart: Retrieving The Authenticated User

Use Illuminate\Support\Facades\Auth;

// Get the currently authenticated user...
$user = Auth::user();

// Get the currently authenticated user's ID...
$id = Auth::id();
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class ProfileController extends Controller
{
    /**
     * Update the user's profile.
     *
     * @param  Request  $request
     * @return Response
     */
    public function update(Request $request)
    {
        // $request->user() returns an instance of the authenticated user...
    }
}

Determining If The Current User Is Authenticated

Use Illuminate\Support\Facades\Auth;

if (Auth::check()) {
    // The user is logged in...
}

Authentication Quickstart: Retrieving The Authenticated User — Structure map

Clickable & Draggable!

Authentication Quickstart: Retrieving The Authenticated User — Related pages: