Raffales-LMS/routes/route.client.php
2024-04-24 10:17:18 +05:45

55 lines
2.5 KiB
PHP

<?php
use App\Http\Controllers\FormsController;
use App\Http\Controllers\RegistrationsController;
use App\Http\Controllers\SubscribersController;
use App\Http\Controllers\WebsiteController;
use Illuminate\Support\Facades\Route;
$lms = new LMS();
define('SITEVARS', LMS::getSiteVars());
// Route::get('/raffels/home',[WebsiteController::class,'home'])->name('raffels.home');
Route::get('/', [RegistrationsController::class, 'home'])->name("home");
Route::get('/direct', [RegistrationsController::class, 'reception'])->middleware('auth')->name("reception.dashboard");
Route::get('/direct/registrations', [RegistrationsController::class, 'reception_registrations'])->middleware('auth')->name("reception.registrations");
Route::get('/direct/faqs', [RegistrationsController::class, 'reception'])->middleware('auth')->name("reception.faqs");
Route::get('/direct/followups', [RegistrationsController::class, 'reception'])->middleware('auth')->name("reception.followups");
Route::get('/{alias}', [RegistrationsController::class, 'home']);
Route::post('/register', [RegistrationsController::class, 'store'])->name('registration.submit');
Route::get('/registration/view/{id}', [RegistrationsController::class, 'view'])->name('registration.view');
Route::middleware('auth')->group(function () {
Route::get('/registration/validate/{id}', [RegistrationsController::class, 'confirmation'])->name('registration.validate');
});
// Route::get('/testimonial/hello', [RegistrationsController::class,'getTestimonial'])->name('testimonial');
Route::get('/spin_the_wheel/reset', function () {
session()->flush();
return redirect("/spin_the_wheel");
})->name("game.reset");
Route::get('/spin_the_wheel', function () {
return view("games.spin_the_wheel.game");
})->name("game.landing");
Route::post('/save_the_winner', function () {
LMS::savespinwheelwinner(request()->registration_id, request()->prize);
redirect("/spin_the_wheel");
})->name("game.savewinner");
// Assuming this is the route for handling the form submission
Route::post('/spin_the_wheel', function () {
$mobile = request('mobile');
if ($registration = LMS::checkRegistrationByMobile($mobile)) {
session()->put('mobile', $mobile);
return view("games.spin_the_wheel.game", compact("registration"));
} else {
// Use the 'with' method to pass data to the view
return redirect("/")->with('registration_error', 'You have not been registered!!! Please Register and Try Again');
}
})->name('game.login');