我面临一个独特的问题,我的数据库中只有 3 个用户数据 John、Cindy 和 Carla,我使用用户名 john 登录,但我得到 Carla 的身份验证数据,它应该是 john 的身份验证数据。
这是我的登录功能LoginController.php
public function login(Request $request) {
$this->validateLogin($request);
$credentials = ['user_id' => \Arr::get('user_id','', $request->input('user_id')),
'password' => \Arr::get('password','', $request->input('user_password'))
];
if(Auth::attempt($credentials)){
return redirect()->intended($this->redirectPath());
}
return back()->withInput($request->except('password'))->withErrors(['Username atau Password Wrong! ']);
}
Run Code Online (Sandbox Code Playgroud)
这是我的用户模型
class User extends Authenticatable {
use Notifiable;
use HasRoles;
protected $table = "m_user";
protected $primaryKey = "user_id";
public function getAuthPassword() {
return $this->hash_password;
}
protected $fillable = [
'user_id', 'nama', 'user_password','hash_password','role', 'company','is_active','created_by','created_at','updated_by','updated_at'
];
protected …Run Code Online (Sandbox Code Playgroud) 我很好奇如何访问module.exports中的另一个对象属性.
这是案例:
module.exports = {
text: 'abcd',
index: (req, res)=>{
console.log(text) <-- is not defined
console.log(this.text) <-- undefined
}
}Run Code Online (Sandbox Code Playgroud)
那么,如何访问文本属性?谢谢你们需要你的解释.
我想按首字母查找所有文档。
情况是当我在mysql中查询时我可以做 WHERE Stores LIKE 'a%'
the result would be all data with the first letter a.
Run Code Online (Sandbox Code Playgroud)
问题是:
query使用mongoose?case-sensitive eg: (a,A)。这将是相同的查询与否?lowercase_field为这种情况创建?mongoose mongodb mongodb-query mongoose-populate mongoose-schema
我想使用 laravel-excel.maatwebsitelibrary 创建下载 excel 功能。我的代码如下:
return Excel::download(new PembukuanExport, 'pembukuan.xlsx');
Run Code Online (Sandbox Code Playgroud)
但是当我运行它时,它给了我这样的错误
无法打开 /var/folders/n_/xh_10hm50dvbwg23cfq_kw3h0000gn/T/laravel-excel-DMBN3reNUrSiamYT 进行写入。
我的笔记本电脑是 macbook,一直在谷歌搜索但找不到正确的答案