add basic logging

This commit is contained in:
TimmensOne
2023-04-04 15:52:47 +02:00
parent a9bb17d7bc
commit faee0574ae
6 changed files with 34 additions and 3 deletions

View File

@@ -3,8 +3,9 @@
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Validation\Rule;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Log;
class UserController extends Controller
{
@@ -29,6 +30,8 @@ class UserController extends Controller
$user = User::create($formFields);
auth()->login($user);
Log::info('User successfully created');
return redirect('/home');
}
@@ -47,6 +50,8 @@ class UserController extends Controller
if (auth()->attempt($formFields)) {
$request->session()->regenerate();
Log::info('User authenticated successfully');
return redirect('/home');
}
}
@@ -58,6 +63,8 @@ class UserController extends Controller
$request->session()->invalidate();
$request->session()->regenerateToken();
Log::info('User successfully logged out');
return redirect('/home');
}
}