デフォルトでは、Laravel 4 の認証機能は 1 つのテーブルにのみ設定できます。
これで、認証が必要な管理テーブルができました。このテーブルは、ユーザー テーブルから分離されています。Sentryをインストールせずにそれを行う方法はありますか?
app/config/auth.php で配列を使用してモデルとテーブルをさらに設定しようとしましたが、Laravel は配列をサポートしていないようです。
編集、回答/質問からコードを移動:
実際にはいいえ、私は次のようなものを使ってみました:
if($res = DB::select('select * from admin where email = ? and password = ?', array(Input::get('email'), Input::get('password')))) {
echo 'success';
//return Response::json(['admin' => Auth::admin()->toArray()], 202);
}
else {
echo 'failed';
//return Response::json(['flash' => 'Authentication failed'], 401);
}
in the method store() of my controller, but failed. Can anyone help me with this?