Explain validations in laravel?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

    1 Answer Written

  •  Sharad Jaiswal
    Answered by Satyam Jaiswal

    Validations in laravel are used to validate user-inputted data on the server.You can use Validator class to validate data in Laravel

    Example

    $validator = Validator::make(
        [
            'name' => 'Anzum',
            'password' => 'Anzumpassword',
            'email' => 'Anzum@example.com'
        ],
        [
            'name' => 'required',
            'password' => 'required|min:8',
            'email' => 'required|email|unique:users'
        ]
    );
    

Related Questions

Please Login or Register to leave a response.

Related Questions

Laravel interview questions

What is Laravel?

Laravel is a free open source "PHP framework" based on the MVC design pattern. It is created by Taylor Otwell...