sekolah_adiwiyata/routes/web.php

48 lines
1.8 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use App\Http\Middleware\Session;
use App\Http\Controllers\Auth\CustomLoginController;
use App\Http\Controllers\Auth\CustomRegisterController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\AjaxController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('login',[CustomLoginController::class,'index'])->name('login');
Route::post('login',[CustomLoginController::class,'post_login'])->name('post_login');
Route::get('register',[CustomRegisterController::class,'index'])->name('register');
Route::post('register',[CustomRegisterController::class,'post_register'])->name('post_register');
Route::post('get/kabupaten',[AjaxController::class,'getKabupaten'])->name('getKabupaten');
Route::post('get/kecamatan',[AjaxController::class,'getKecamatan'])->name('getKecamatan');
Route::post('get/sekolah',[AjaxController::class,'getSekolah'])->name('getSekolah');
Route::get('sekolahNpsn',[AjaxController::class,'sekolahNpsn'])->name('sekolahNpsn');
Route::get('hash/{hash}', function ($hash) {
return Hash::make($hash);
});
Route::middleware(Session::class)->name('modules.')->group(function () {
include_route_files(__DIR__ . '/modules');
Route::get('logout',[CustomLoginController::class,'logout'])->name('logout');
});
Route::get('/', function () {
return redirect('login');
});
// Auth::routes();
// Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');