master

laravel/framework

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

OtherDeviceLogout.php

TLDR

This file defines the OtherDeviceLogout event class, which is used to represent an event where a user is logged out from a device other than the current one.

Classes

OtherDeviceLogout

This class represents the OtherDeviceLogout event. It has the following properties:

  • $guard: The authentication guard name (string).
  • $user: The authenticated user (implementing the Authenticatable interface).

It has the following methods:

  • __construct($guard, $user): Initializes a new instance of the OtherDeviceLogout event. Accepts the $guard string and the $user instance implementing the Authenticatable interface.
<?php

namespace Illuminate\Auth\Events;

use Illuminate\Queue\SerializesModels;

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