Laravel authentication custom username and password encryption
I wanted to learn Laravel, and to do so, I wanted to link my Discord bot to a monitoring website.
The user can set up a password, using a command on Discord, that is encrypted using Bcrypt (with the bcrypt npm package).
My goal is to provide a web page in which the user can enter his client ID and his previously set up password to login, then have access to some basic functionalities to manage the servers he's moderator on.
I have the following login page:
<div class="panel">
<h1 class="title">Get connected !</h1>
<h2 class="detail">Login and manage your servers !</h2>
<form method="POST" action=" route('login') ">
@csrf
<label for="id" class="label">Client id :</label>
<input type="text" placeholder="Client id" name="id" value=" old('id') " autofocus>
<label for="password" class="label">Password :</label>
<input type="password" placeholder="Password" name="password">
<input type="submit" value=" __('Login') ">
</form>
</div>
@if (count($errors) > 0)
<div class="form-error">
<span class="label">Your email and/or password isn't correct.</span>
</div>
@endif
Also, here is my User class:
class User extends Authenticatable
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password'
];
My users table has three columns:
- id (which is the client id on Discord)
- xp (integer)
- password (of Blob type, to store the bcrypt encrypted password)
Because I'm using the default authentication system, I just wrote the username function in app/Http/Controllers/Auth/LoginController.php:
public function username()
return "id";
That system doesn't work and I don't know why, as I've just started learning Laravel. I was thinking of an encryption issue, but Laravel seem to be using Bcrypt too.
EDIT
I don't have php errors, but when I try to login, I'm being told that my credentials are wrong.
I changed the password type from Blob to Varchar and the username function to a variable like:
protected $username = "id"
EDIT 2
My laravel version is 5.7.13.
I tried adding the table name in my User model but it still doesn't work.
About the way I'm creating my users, it's not done using php but Javascript, as you're only supposed to have the possibility to register if you're on a Discord server that has my bot in it.
When the register command is triggered by a user, the following function is called on my database:
CREATE DEFINER=`root`@`localhost` FUNCTION `addUser`(user_id VARCHAR(18), server_id VARCHAR(18)) RETURNS tinyint(1) DETERMINISTIC
BEGIN
IF((SELECT COUNT(id) FROM (SELECT * FROM servers WHERE id=server_id) AS a) = 0) THEN
INSERT INTO servers VALUES (server_id);
INSERT INTO aremembersof VALUES ("notregistered", 3, server_id);
END IF;
IF((SELECT COUNT(id) FROM (SELECT * FROM users WHERE id=user_id) AS a) = 0) THEN
INSERT INTO users VALUES (user_id);
END IF;
IF ((SELECT COUNT(id) FROM (SELECT * FROM aremembersof WHERE id_servers=server_id AND id=user_id) AS a) = 0) THEN
INSERT INTO aremembersof VALUES (user_id, 2, server_id);
ELSE
RETURN false;
END IF;
RETURN true;
END
No password is set when the user first registers. This can seem strange but the password is only used to log in the management website. To define a password, the user has to call the setPassword command, which code is:
if(args.length > 0)
bcrypt.hash(args[0], 0, async (err, hash) =>
await dbUtilities.execute("UPDATE users SET password = "" + hash + "" WHERE id = "" + message.author.id + """);
message.reply(embed:
color: parseInt(colors.success, 16),
description: "Your password has been changed!"
);
);
return;
message.reply(embed:
color: parseInt(colors.danger, 16),
description: "You have to specify a password!"
);
Actually some other checks are done in order to verify the user is not setting his new password from a public channel but it's not relevant here.
Also, args[0] corresponds to the password typed by the user.
EDIT 3
As suggested, I changed my system so that the password has to be set on the website directly. Thus, the setPassword command sets a token that is used on the website on an activation page.
Here is the function called when submitting the form:
public function activatePost(Request $request)
confirmed'
]);
$password_reset = PasswordReset::where('token', $request->token)->first();
if($password_reset != null)
$user = User::where('id', $password_reset->id)->first();
$user->password = Hash::make($request->password);
$user->save();
return redirect()->route('login')->with('message', 'Your password has been set!');
else
// TODO
I still can't connect.
php laravel authentication bcrypt
|
show 16 more comments
I wanted to learn Laravel, and to do so, I wanted to link my Discord bot to a monitoring website.
The user can set up a password, using a command on Discord, that is encrypted using Bcrypt (with the bcrypt npm package).
My goal is to provide a web page in which the user can enter his client ID and his previously set up password to login, then have access to some basic functionalities to manage the servers he's moderator on.
I have the following login page:
<div class="panel">
<h1 class="title">Get connected !</h1>
<h2 class="detail">Login and manage your servers !</h2>
<form method="POST" action=" route('login') ">
@csrf
<label for="id" class="label">Client id :</label>
<input type="text" placeholder="Client id" name="id" value=" old('id') " autofocus>
<label for="password" class="label">Password :</label>
<input type="password" placeholder="Password" name="password">
<input type="submit" value=" __('Login') ">
</form>
</div>
@if (count($errors) > 0)
<div class="form-error">
<span class="label">Your email and/or password isn't correct.</span>
</div>
@endif
Also, here is my User class:
class User extends Authenticatable
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password'
];
My users table has three columns:
- id (which is the client id on Discord)
- xp (integer)
- password (of Blob type, to store the bcrypt encrypted password)
Because I'm using the default authentication system, I just wrote the username function in app/Http/Controllers/Auth/LoginController.php:
public function username()
return "id";
That system doesn't work and I don't know why, as I've just started learning Laravel. I was thinking of an encryption issue, but Laravel seem to be using Bcrypt too.
EDIT
I don't have php errors, but when I try to login, I'm being told that my credentials are wrong.
I changed the password type from Blob to Varchar and the username function to a variable like:
protected $username = "id"
EDIT 2
My laravel version is 5.7.13.
I tried adding the table name in my User model but it still doesn't work.
About the way I'm creating my users, it's not done using php but Javascript, as you're only supposed to have the possibility to register if you're on a Discord server that has my bot in it.
When the register command is triggered by a user, the following function is called on my database:
CREATE DEFINER=`root`@`localhost` FUNCTION `addUser`(user_id VARCHAR(18), server_id VARCHAR(18)) RETURNS tinyint(1) DETERMINISTIC
BEGIN
IF((SELECT COUNT(id) FROM (SELECT * FROM servers WHERE id=server_id) AS a) = 0) THEN
INSERT INTO servers VALUES (server_id);
INSERT INTO aremembersof VALUES ("notregistered", 3, server_id);
END IF;
IF((SELECT COUNT(id) FROM (SELECT * FROM users WHERE id=user_id) AS a) = 0) THEN
INSERT INTO users VALUES (user_id);
END IF;
IF ((SELECT COUNT(id) FROM (SELECT * FROM aremembersof WHERE id_servers=server_id AND id=user_id) AS a) = 0) THEN
INSERT INTO aremembersof VALUES (user_id, 2, server_id);
ELSE
RETURN false;
END IF;
RETURN true;
END
No password is set when the user first registers. This can seem strange but the password is only used to log in the management website. To define a password, the user has to call the setPassword command, which code is:
if(args.length > 0)
bcrypt.hash(args[0], 0, async (err, hash) =>
await dbUtilities.execute("UPDATE users SET password = "" + hash + "" WHERE id = "" + message.author.id + """);
message.reply(embed:
color: parseInt(colors.success, 16),
description: "Your password has been changed!"
);
);
return;
message.reply(embed:
color: parseInt(colors.danger, 16),
description: "You have to specify a password!"
);
Actually some other checks are done in order to verify the user is not setting his new password from a public channel but it's not relevant here.
Also, args[0] corresponds to the password typed by the user.
EDIT 3
As suggested, I changed my system so that the password has to be set on the website directly. Thus, the setPassword command sets a token that is used on the website on an activation page.
Here is the function called when submitting the form:
public function activatePost(Request $request)
confirmed'
]);
$password_reset = PasswordReset::where('token', $request->token)->first();
if($password_reset != null)
$user = User::where('id', $password_reset->id)->first();
$user->password = Hash::make($request->password);
$user->save();
return redirect()->route('login')->with('message', 'Your password has been set!');
else
// TODO
I still can't connect.
php laravel authentication bcrypt
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
in yourLoginController
tryprotected $username = 'id';
– adam
Nov 13 '18 at 23:16
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typicallyprotected $table = 'users';
.
– adam
Nov 14 '18 at 14:52
|
show 16 more comments
I wanted to learn Laravel, and to do so, I wanted to link my Discord bot to a monitoring website.
The user can set up a password, using a command on Discord, that is encrypted using Bcrypt (with the bcrypt npm package).
My goal is to provide a web page in which the user can enter his client ID and his previously set up password to login, then have access to some basic functionalities to manage the servers he's moderator on.
I have the following login page:
<div class="panel">
<h1 class="title">Get connected !</h1>
<h2 class="detail">Login and manage your servers !</h2>
<form method="POST" action=" route('login') ">
@csrf
<label for="id" class="label">Client id :</label>
<input type="text" placeholder="Client id" name="id" value=" old('id') " autofocus>
<label for="password" class="label">Password :</label>
<input type="password" placeholder="Password" name="password">
<input type="submit" value=" __('Login') ">
</form>
</div>
@if (count($errors) > 0)
<div class="form-error">
<span class="label">Your email and/or password isn't correct.</span>
</div>
@endif
Also, here is my User class:
class User extends Authenticatable
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password'
];
My users table has three columns:
- id (which is the client id on Discord)
- xp (integer)
- password (of Blob type, to store the bcrypt encrypted password)
Because I'm using the default authentication system, I just wrote the username function in app/Http/Controllers/Auth/LoginController.php:
public function username()
return "id";
That system doesn't work and I don't know why, as I've just started learning Laravel. I was thinking of an encryption issue, but Laravel seem to be using Bcrypt too.
EDIT
I don't have php errors, but when I try to login, I'm being told that my credentials are wrong.
I changed the password type from Blob to Varchar and the username function to a variable like:
protected $username = "id"
EDIT 2
My laravel version is 5.7.13.
I tried adding the table name in my User model but it still doesn't work.
About the way I'm creating my users, it's not done using php but Javascript, as you're only supposed to have the possibility to register if you're on a Discord server that has my bot in it.
When the register command is triggered by a user, the following function is called on my database:
CREATE DEFINER=`root`@`localhost` FUNCTION `addUser`(user_id VARCHAR(18), server_id VARCHAR(18)) RETURNS tinyint(1) DETERMINISTIC
BEGIN
IF((SELECT COUNT(id) FROM (SELECT * FROM servers WHERE id=server_id) AS a) = 0) THEN
INSERT INTO servers VALUES (server_id);
INSERT INTO aremembersof VALUES ("notregistered", 3, server_id);
END IF;
IF((SELECT COUNT(id) FROM (SELECT * FROM users WHERE id=user_id) AS a) = 0) THEN
INSERT INTO users VALUES (user_id);
END IF;
IF ((SELECT COUNT(id) FROM (SELECT * FROM aremembersof WHERE id_servers=server_id AND id=user_id) AS a) = 0) THEN
INSERT INTO aremembersof VALUES (user_id, 2, server_id);
ELSE
RETURN false;
END IF;
RETURN true;
END
No password is set when the user first registers. This can seem strange but the password is only used to log in the management website. To define a password, the user has to call the setPassword command, which code is:
if(args.length > 0)
bcrypt.hash(args[0], 0, async (err, hash) =>
await dbUtilities.execute("UPDATE users SET password = "" + hash + "" WHERE id = "" + message.author.id + """);
message.reply(embed:
color: parseInt(colors.success, 16),
description: "Your password has been changed!"
);
);
return;
message.reply(embed:
color: parseInt(colors.danger, 16),
description: "You have to specify a password!"
);
Actually some other checks are done in order to verify the user is not setting his new password from a public channel but it's not relevant here.
Also, args[0] corresponds to the password typed by the user.
EDIT 3
As suggested, I changed my system so that the password has to be set on the website directly. Thus, the setPassword command sets a token that is used on the website on an activation page.
Here is the function called when submitting the form:
public function activatePost(Request $request)
confirmed'
]);
$password_reset = PasswordReset::where('token', $request->token)->first();
if($password_reset != null)
$user = User::where('id', $password_reset->id)->first();
$user->password = Hash::make($request->password);
$user->save();
return redirect()->route('login')->with('message', 'Your password has been set!');
else
// TODO
I still can't connect.
php laravel authentication bcrypt
I wanted to learn Laravel, and to do so, I wanted to link my Discord bot to a monitoring website.
The user can set up a password, using a command on Discord, that is encrypted using Bcrypt (with the bcrypt npm package).
My goal is to provide a web page in which the user can enter his client ID and his previously set up password to login, then have access to some basic functionalities to manage the servers he's moderator on.
I have the following login page:
<div class="panel">
<h1 class="title">Get connected !</h1>
<h2 class="detail">Login and manage your servers !</h2>
<form method="POST" action=" route('login') ">
@csrf
<label for="id" class="label">Client id :</label>
<input type="text" placeholder="Client id" name="id" value=" old('id') " autofocus>
<label for="password" class="label">Password :</label>
<input type="password" placeholder="Password" name="password">
<input type="submit" value=" __('Login') ">
</form>
</div>
@if (count($errors) > 0)
<div class="form-error">
<span class="label">Your email and/or password isn't correct.</span>
</div>
@endif
Also, here is my User class:
class User extends Authenticatable
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password'
];
My users table has three columns:
- id (which is the client id on Discord)
- xp (integer)
- password (of Blob type, to store the bcrypt encrypted password)
Because I'm using the default authentication system, I just wrote the username function in app/Http/Controllers/Auth/LoginController.php:
public function username()
return "id";
That system doesn't work and I don't know why, as I've just started learning Laravel. I was thinking of an encryption issue, but Laravel seem to be using Bcrypt too.
EDIT
I don't have php errors, but when I try to login, I'm being told that my credentials are wrong.
I changed the password type from Blob to Varchar and the username function to a variable like:
protected $username = "id"
EDIT 2
My laravel version is 5.7.13.
I tried adding the table name in my User model but it still doesn't work.
About the way I'm creating my users, it's not done using php but Javascript, as you're only supposed to have the possibility to register if you're on a Discord server that has my bot in it.
When the register command is triggered by a user, the following function is called on my database:
CREATE DEFINER=`root`@`localhost` FUNCTION `addUser`(user_id VARCHAR(18), server_id VARCHAR(18)) RETURNS tinyint(1) DETERMINISTIC
BEGIN
IF((SELECT COUNT(id) FROM (SELECT * FROM servers WHERE id=server_id) AS a) = 0) THEN
INSERT INTO servers VALUES (server_id);
INSERT INTO aremembersof VALUES ("notregistered", 3, server_id);
END IF;
IF((SELECT COUNT(id) FROM (SELECT * FROM users WHERE id=user_id) AS a) = 0) THEN
INSERT INTO users VALUES (user_id);
END IF;
IF ((SELECT COUNT(id) FROM (SELECT * FROM aremembersof WHERE id_servers=server_id AND id=user_id) AS a) = 0) THEN
INSERT INTO aremembersof VALUES (user_id, 2, server_id);
ELSE
RETURN false;
END IF;
RETURN true;
END
No password is set when the user first registers. This can seem strange but the password is only used to log in the management website. To define a password, the user has to call the setPassword command, which code is:
if(args.length > 0)
bcrypt.hash(args[0], 0, async (err, hash) =>
await dbUtilities.execute("UPDATE users SET password = "" + hash + "" WHERE id = "" + message.author.id + """);
message.reply(embed:
color: parseInt(colors.success, 16),
description: "Your password has been changed!"
);
);
return;
message.reply(embed:
color: parseInt(colors.danger, 16),
description: "You have to specify a password!"
);
Actually some other checks are done in order to verify the user is not setting his new password from a public channel but it's not relevant here.
Also, args[0] corresponds to the password typed by the user.
EDIT 3
As suggested, I changed my system so that the password has to be set on the website directly. Thus, the setPassword command sets a token that is used on the website on an activation page.
Here is the function called when submitting the form:
public function activatePost(Request $request)
confirmed'
]);
$password_reset = PasswordReset::where('token', $request->token)->first();
if($password_reset != null)
$user = User::where('id', $password_reset->id)->first();
$user->password = Hash::make($request->password);
$user->save();
return redirect()->route('login')->with('message', 'Your password has been set!');
else
// TODO
I still can't connect.
php laravel authentication bcrypt
php laravel authentication bcrypt
edited Nov 22 '18 at 12:18
christophechichmanian
asked Nov 13 '18 at 23:02
christophechichmanianchristophechichmanian
87
87
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
in yourLoginController
tryprotected $username = 'id';
– adam
Nov 13 '18 at 23:16
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typicallyprotected $table = 'users';
.
– adam
Nov 14 '18 at 14:52
|
show 16 more comments
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
in yourLoginController
tryprotected $username = 'id';
– adam
Nov 13 '18 at 23:16
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typicallyprotected $table = 'users';
.
– adam
Nov 14 '18 at 14:52
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
in your
LoginController
try protected $username = 'id';
– adam
Nov 13 '18 at 23:16
in your
LoginController
try protected $username = 'id';
– adam
Nov 13 '18 at 23:16
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typically
protected $table = 'users';
.– adam
Nov 14 '18 at 14:52
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typically
protected $table = 'users';
.– adam
Nov 14 '18 at 14:52
|
show 16 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290805%2flaravel-authentication-custom-username-and-password-encryption%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290805%2flaravel-authentication-custom-username-and-password-encryption%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You've done an awesome job of laying out your code, but you'll get quicker answers if you refine your question, what kinds of errors are you getting? Do you have the php logs we can look at? have you read this? I'm worried your question could be seen as too broad & get flags and downvotes. Rather than show us all the code, find the error, that'll shed more light on the situation.
– admcfajn
Nov 13 '18 at 23:11
in your
LoginController
tryprotected $username = 'id';
– adam
Nov 13 '18 at 23:16
The password should be a varchar, not a blob.
– adam
Nov 13 '18 at 23:23
I added a few details, but I don't know where the problem is, so I'm afraid I can't give you more
– christophechichmanian
Nov 14 '18 at 9:19
@christophechichmanian which Laravel version are you using? Also how are you creating your user? The code you use to create your user would be helpful in determining the issue. Your user model doesn't have a database table defined, typically
protected $table = 'users';
.– adam
Nov 14 '18 at 14:52