Cześć, chciałem zrobić coś takiego, że podczas logowania użytkownika do systemu będzie sprawdzane czy użytkownik logujący się jest aktywny.
Tabela z użytkownikami.
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
/**
* Set the default image, until the user changes it.
*/
$table->string('image')->default('default.png');
$table->boolean('active')->default(false);
$table->rememberToken();
$table->timestamps();
});
}
w dokumentacji technicznej znalazłem coś takiego.
if (Auth::attempt(['email' => $email, 'password' => $password, 'active' => 1])) {
// The user is active, not suspended, and exists.
}
https://laravel.com/docs/5.4/authentication#authenticating-users
Wydaję się to odpowiednie rozwiązanie, o to mi chodziło! tylko jest jeden problem! TO NIE DZIAŁA
Teraz pytanie czy ktoś jest wstanie mi wyjaśnić jak zrobić aby to działało :D
z góry dziękuję za pomoc.