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']; }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);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community