Laravel 5.3では何かが変更されました。Laravel 5.3追加条件による認証
<?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
class AuthController extends Controller
{
/**
* Handle an authentication attempt.
*
* @return Response
*/
public function authenticate()
{
if (Auth::attempt(['email' => $email, 'password' => $password])) {
// Authentication passed...
return redirect()->intended('dashboard');
}
}
}
しかし、このコントローラ:ドキュメントで私たちは、追加の条件を追加することができ、このコントローラがあるAuthControllerはもう存在しません.....だけLoginController
私はAuthControllerことを作成するべきでは ありまたは何?
そこで質問は、あなたがそのために5.3でLoginController
を使用することができます
'active' => 1
ニース...私はこのようにそれを作ったよ!を) - > user() - > active){ auth() - > logout(); リダイレクト( 'login') - > with( 'warning'、 'Sie sind noch nicht aktiviert!'); } } – lewis4u
喜んで助けました。 –
もう1つの質問ですが、今すぐ新しいユーザーを登録するとすぐにログインします。これを防ぐ方法は?それで私は新しい質問をするべきですか? – lewis4u