Support the ongoing development of Laravel.io →
Authentication Session
Last updated 2 years ago.
0

update: this is my app/User.php ... i read online that the problem could be here

<?php namespace App; use Illuminate\Auth\Authenticatable; use Illuminate\Database\Eloquent\Model; use Illuminate\Auth\Passwords\CanResetPassword; use Illuminate\Foundation\Auth\Access\Authorizable; use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; class User extends Model implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract { use Authenticatable, Authorizable, CanResetPassword; /** * The database table used by the model. * * @var string */ protected $table = 'users'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['first_name', 'last_name', 'username', 'email', 'password']; /** * The attributes excluded from the model's JSON form. * * @var array */ protected $hidden = ['password']; }
0

return User::create(['email' => $email, 'password' => bcrypt($password)]);

with this row it works correctly. (null username)

return User::create(['email' => $email, 'password' => bcrypt($password), 'username' => $username]);

in this way , it works but with null username (and i cannot understand why)

$newuser['email'] = $email; $newuser['username'] = $username; $password=Hash::make('password'); $newuser['password'] = $password; return User::create($newuser);

finally in this way it saves the user correctly but the login doest not work...

edit: Solved, it works with $password = bcrypt($password);

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

r0bin51 r0bin51 Joined 9 Dec 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.