Explain validations in laravel?

devquora
devquora

Posted On: Apr 19, 2024

 

    2 Answers Written

  •  devquora
    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'
        ]
    );
    
  •  devquora
    Answered by Gobinda BarmanSkills based questions

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...