<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\UserController;
use App\Http\Controllers\Auth\PasswordResetController;
use App\Http\Controllers\Auth\GoogleController;

Route::get('/', function () {
    return view('welcome2');
});

Route::get('/register', [UserController::class, 'showRegistrationForm'])->name('register');
Route::post('/register', [UserController::class, 'registerStaff'])->name('postRegister');

Route::get('/login', [UserController::class, 'showLoginForm'])->name('login');
Route::post('/login', [UserController::class, 'loginStaff'])->name('postLogin');


Route::get('/dash', [UserController::class, 'dashboard'])->name('dashboard');

// Route::get('/password/reset', [PasswordResetController::class, 'showLinkRequestForm'])->name('password.request');
// Route::post('/password/email', [PasswordResetController::class, 'sendResetLinkEmail'])->name('password.email');
// Route::get('/password/reset/{token}', [PasswordResetController::class, 'showResetForm'])->name('password.reset');
// Route::post('/password/reset', [PasswordResetController::class, 'reset'])->name('password.update');

Route::get('/password/reset/{token}', [PasswordResetController::class, 'showResetForm'])->name('password.reset');
Route::post('/password/reset', [PasswordResetController::class, 'reset'])->name('password.update');


Route::get('login/google', [GoogleController::class, 'redirectToGoogle'])->name('login.google');
Route::get('login/google/callback', [GoogleController::class, 'handleGoogleCallback']);
Route::get('/run-scheduler', function () {
    \Artisan::call('schedule:run');
    return 'Scheduler executed.';
});