master

laravel/framework

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

Logout.php

TLDR

The Logout class in the file src/Illuminate/Auth/Events/Logout.php is an event class that represents a user logging out of the application. It includes the guard name and the authenticated user as properties.

Classes

Logout

The Logout class is an event class that represents a user logging out of the application. It includes the following properties:

  • $guard: The authentication guard name
  • $user: The authenticated user object implementing the \Illuminate\Contracts\Auth\Authenticatable interface

The class has a constructor that takes the guard name and the user as parameters and assigns them to the respective properties.

<?php

namespace Illuminate\Auth\Events;

use Illuminate\Queue\SerializesModels;

class Logout
{
    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;
    }
}