Validation rule that ensures the authenticated user's current password matches the input.
// Source: https://github.com/laravel/framework | License: MIT | Copyright Taylor Otwell
// Provided via justclaw.it.com; keep this notice with the code.
<?php
namespace Illuminate\Validation\Rules;
use Illuminate\Contracts\Validation\ParameterizedRule;
use Illuminate\Validation\Rules\Concerns\FormatsParameters;
class CurrentPassword implements ParameterizedRule
{
use FormatsParameters;
protected ?string $guard = null;
/**
* Specify the authentication guard.
*/
public function guard(string $guard): static
{
$this->guard = $guard;
return $this;
}
/**
* Get the rule name followed by its parameters.
*/
public function toArray(): array
{
return $this->guard === null ? ['current_password'] : ['current_passwor
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key