<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\IndexController;
use Illuminate\Support\Facades\Session;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', [IndexController::class, 'connexion']);
Route::match(['get', 'post'], '/login', [IndexController::class, 'login'])->name('login');

Route::get('/logout', [IndexController::class, 'logout'])->name('logout');



Route::group(['middleware' => ['load_tenant']], function () { //Dashboard
    Route::get('/home', [IndexController::class, 'index'])->name('home');


    Route::post('/gs_sms/envoiMsg', [IndexController::class, 'envoiMsg'])->name('envoiMsg');

    //Route du profil
    Route::get('/gs_sms/profil/{num}', [IndexController::class, 'profil'])->name('profile');
    Route::post('/gs_sms/profile_update', [IndexController::class, 'updateProfile'])->name('update_prof');
    Route::post('/gs_sms/password_update', [IndexController::class, 'updatePassword'])->name('update_passwd');
});
