Skip to content

Commit

Permalink
fix auth login
Browse files Browse the repository at this point in the history
  • Loading branch information
mriilah committed Jun 7, 2024
1 parent 2210b25 commit 7c6e59e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
16 changes: 1 addition & 15 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Http\Controllers\Controller;
use App\Models\User;
use App\Models\Profile;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
Expand Down Expand Up @@ -53,10 +52,6 @@ protected function validator(array $data)
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
'umur' => ['required'],
'bio' => ['required'],
'alamat' => ['required'],

]);
}

Expand All @@ -68,19 +63,10 @@ protected function validator(array $data)
*/
protected function create(array $data)
{
$user = User::create([
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);

Profile::create([
'umur' => $data['umur'],
'bio' => $data['bio'],
'alamat' => $data['alamat'],
'users_id' => $user->id,
]);

return $user;
}
}
10 changes: 4 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Support\Facades\Route;

use Illuminate\Support\Facades\Auth;
/*
|--------------------------------------------------------------------------
| Web Routes
Expand All @@ -25,12 +25,10 @@
return view('page.contact');
});

Route::middleware(['first', 'second'])->group(function () {
Route::get('/', function () {
// Uses first & second middleware...
});

});
Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

Auth::routes();

Expand Down

0 comments on commit 7c6e59e

Please sign in to comment.