master

laravel/framework

Last updated at: 29/12/2023 09:20

Authenticated.php

TLDR

This file contains the Authenticated class, which is an event class in the Illuminate\Auth\Events namespace. The class represents an authentication event and stores information about the authenticated user and the authentication guard.

Classes

Authenticated

The Authenticated class is an event class used to represent an authentication event. It is located in the Illuminate\Auth\Events namespace. This class has the following properties:

  • $guard: The authentication guard name (string).
  • $user: The authenticated user, implementing the \Illuminate\Contracts\Auth\Authenticatable interface.

The class has a constructor method that accepts the following parameters:

  • $guard (string): The authentication guard name.
  • $user (\Illuminate\Contracts\Auth\Authenticatable): The authenticated user.
<?php

namespace Illuminate\Auth\Events;

use Illuminate\Queue\SerializesModels;

class Authenticated
{
    use SerializesModels;

    /**
     * The authentication guard name.
     *
     * @var string
     */
    public $guard;

    /**
     * The authenticated user.
     *
     * @var \Illuminate\Contracts\Auth\Authenticatable
     */
    public $user;

    /**
     * Create a new event instance.
     *
     * @param  string  $guard
     * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
     * @return void
     */
    public function __construct($guard, $user)
    {
        $this->user = $user;
        $this->guard = $guard;
    }
}