<?php namespace Orchestra\Foundation\Validation;

use Orchestra\Support\Validator;

class AuthenticateUser extends Validator
{
    /**
     * List of rules.
     *
     * @var array
     */
    protected $rules = [
        'email' => ['required', 'email'],
    ];

    /**
     * On login scenario.
     *
     * @return void
     */
    protected function onLogin()
    {
        $this->rules['password'] = ['required'];
    }
}

<?php namespace Orchestra\Foundation\Validation;

use Orchestra\Support\Validator;

class AuthenticateUser extends Validator
{
    /**
     * List of rules.
     *
     * @var array
     */
    protected $rules = [
        'email' => ['required', 'email'],
        'fullname' => ['sometimes', 'required'],
    ];

    /**
     * On login scenario.
     *
     * @return void
     */
    protected function onLogin()
    {
        $this->rules['password'] = ['required'];
    }
}

Add fullname validation if it's presented.
Add fullname validation if it's presented.

Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
