add basic logging
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user