I'm kinda new to laravel (5.7) and I'm stuck trying to create a registration form. the validation works great but then the page refresh and nothing happens, no errors, nothing changes on the registration form with no records on the database.
Here is my controller, I tweaked the basic form that laravel gives you to start with so it matches my database. And I created a folder for my models, so I changed the path to the "users" model that's all the tweaks I've done on this.
namespace App\Http\Controllers\Auth;
use App\Models\users;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
use RegistersUsers;
protected $redirectTo = '/home';
public function __construct()
{
$this->middleware('guest');
}
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users,User_Email',
'passowrd' => 'required|string|min:2|confirmed',
]);
}
protected function create(array $data)
{
return users::create([
'User_Nom' => $data['name'],
'User_Email' => $data['email'],
'User_pwd' => Hash::make($data['password']),
]);
}
}
I'm guessing that it has something to do with my Model but I can't put my finger in it. so here is my Model :
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class users extends Authenticatable
{
use Notifiable;
protected $primaryKey = 'User_Id';
protected $table = 'users';
protected $fillable = [
'User_Id', 'User_Nom', 'User_Prenom', 'User_pwd', 'User_Email', 'User_Tel', 'User_Fax', 'User_Post'
];
protected $hidden = [
'User_pwd', 'remember_token',
];
}
(Sorry for the indentation the copy - past messed it up)
Thank you