master

laravel/framework

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

Validated.php

TLDR

The file Validated.php contains a class Validated which is an event in the Illuminate\Auth\Events namespace. This event is used to represent the successful validation of a user's credentials in the authentication process.

Classes

Validated

The Validated class represents the event of successful validation of a user's credentials in the authentication process. It is located in the Illuminate\Auth\Events namespace.

Properties

  • $guard: The authentication guard name.
  • $user: The user retrieved and validated from the User Provider.

Constructor

The Validated class has a constructor that accepts two parameters:

  • $guard: The name of the authentication guard.
  • $user: An instance of Illuminate\Contracts\Auth\Authenticatable representing the validated user.

[Illuminate\Contracts\Auth\Authenticatable]: An interface for representing an authenticated user in Laravel.

<?php

namespace Illuminate\Auth\Events;

use Illuminate\Queue\SerializesModels;

class Validated
{
    use SerializesModels;

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

    /**
     * The user retrieved and validated from the User Provider.
     *
     * @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;
    }
}