B
B
Blud732014-03-06 14:16:01
Laravel
Blud73, 2014-03-06 14:16:01

How to validate authorization in Laravel?

There is a registration, there is a field in the active table for each user, before authorization, you need to check that the Active field = 1, if not, then do not authorize. How can this be done using Laravel?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andr'U Sender, 2014-03-11
@Blud73

$u = array(
            'username' => Input::get('email'),
            'password' => Input::get('password'),
            'active'=>1 //вот ваш параметр по которому тоже будет выполняться проверка при авторизации
        );
        if (Auth::attempt($u)) {
                  .....

A
Alexey, 2014-03-07
@xelam

here are details about validation in models http://laravel.ru/articles/odd_bod/your-first-mode...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question