laravel5.3で認証を独自に行う方法を教えてください。
Eroquentは利用しておらずクエリビルダになります。
マニュアルを見たのですがいまいちわからなかったので質問します
if(Auth::attempt(['name'=>$user, 'password' => $password])){ return redirect()->intended('/'); } ``` こちらで認証を行おうとすると、 QueryException in Connection.php line 764: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'site.app\models\users' doesn't exist (SQL: select * from `App\Models\Users` where `name` = limit 1) というエラーと PDOException in Connection.php line 333: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'site.app\models\users' doesn't exist というエラーが発生します。 DBにusersテーブルは存在しており、マイグレーションで作成したものになります。 site.app\models\usersは もともとあったUser.phpを変更してapp/modelsに以下内容で作成しています ```ここに言語を入力 class Users extends Authenticatable { use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; } ``` 質問として成り立っているかわからないですが、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2016/11/27 03:15