172 lines
5.6 KiB
PHP
172 lines
5.6 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use App\Http\Controllers\FormController;
|
|
|
|
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
use App\Http\Controllers\ForgotPasswordController;
|
|
|
|
use App\Http\Controllers\Auth\ResetPasswordController;
|
|
|
|
use App\Http\Controllers\NewPasswordController;
|
|
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
|
|
|
use App\Http\Controllers\userController;
|
|
use App\Http\Controllers\Pending_UserController;
|
|
|
|
use App\Http\Controllers\Auth\RegisteredUserController;
|
|
|
|
use App\Http\Controllers\CustomRegistrationController;
|
|
|
|
|
|
|
|
Route::get('/download-template', function () {
|
|
$filePath = public_path('templateExcel/FinalTemplate .xlsx');
|
|
$fileName = 'FinalTemplate .xlsx';
|
|
|
|
return response()->download($filePath, $fileName);
|
|
});
|
|
|
|
|
|
|
|
Route::post('/register', [CustomRegistrationController::class, 'store'])->name('register');
|
|
|
|
Route::get('/your-verification-route/{id}/{hash}', [UserController::class, 'yourVerificationMethod'])
|
|
->middleware(['auth', 'signed', 'throttle:6,1'])
|
|
->name('verification.verify');
|
|
|
|
|
|
Route::get('/receiveThisShit', function () {
|
|
return redirect()->route('test');
|
|
})->name('verification.notice');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| 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::middleware(['auth', 'verified'])->group(function () {
|
|
|
|
|
|
// Rotas protegidas que exigem verificação de e-mail
|
|
|
|
Route::get('/', function () {
|
|
return view('Admin/index');
|
|
})->name('home');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Create Users with Super Admin
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| 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!
|
|
|
|
|
*/
|
|
});
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| User_Type (Super_Administrador)
|
|
|--------------------------------------------------------------------------
|
|
|*** Routes unique access to the Super_Administrator, due to its sensitive data.
|
|
|
|
|
|
|
|
*/
|
|
Route::middleware(['auth', 'verified', 'checksuperadmin'])->group(function () {
|
|
Route::get('usersProfiles/{id}', [userController::class, 'UserProfile'])->name('usersProfiles');
|
|
Route::post('enviar-formulario', [FormController::class, 'enviarEmail'])->name('enviar.formulario');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| CRUD - users
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Definition routes to implement the CRUD model
|
|
|
|
|
*/
|
|
Route::get('users/ListUsers', [userController::class, 'ListUsers'])->name('users.list');
|
|
Route::get('users/{id}', [userController::class, 'show'])->name('users.Show');
|
|
Route::get('users/{id}/edit', [userController::class, 'edit'])->name('users.edit');
|
|
Route::put('users/{user}', [userController::class, 'update'])->name('users.update');
|
|
Route::delete('users/{user}', [UserController::class, 'destroy'])->name('users.destroy');
|
|
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Create Users with Super Admin
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| 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('/CreateUsers', [Pending_UserController::class, 'ListPendingUsers'])->name('CreateUsers');
|
|
|
|
Route::get('/CreateUsers/{id}', [Pending_UserController::class, 'ShowFormUser'])->name('ShowPendingUser');
|
|
|
|
Route::get('formulario', function () {
|
|
return view('email/FormAdmin');
|
|
})->name('formulario');
|
|
|
|
Route::post('formulario/receive', [Pending_UserController::class, 'store'])->name('criarUser');
|
|
});
|
|
|
|
|
|
|
|
// Rotas protegidas que exigem verificação de e-mail e user_type Super_Admin
|
|
// Route::get('/register', [RegisteredUserController::class, 'create'])
|
|
// ->name('register');
|
|
// Route::post('/register', [RegisteredUserController::class, 'store'])
|
|
|
|
|
|
// Route::get('/test-email', function () {
|
|
// $to = 'ygbanzato@isptgroup.com';
|
|
// $subject = 'Test Email from Laravel';
|
|
|
|
// $message = Mail::raw('This is a test email from Laravel.', function ($message) use ($to, $subject) {
|
|
// $message->to($to)->subject($subject);
|
|
// });
|
|
|
|
// if ($message) {
|
|
// return 'Email sent successfully';
|
|
// } else {
|
|
// return 'Failed to send email';
|
|
// }
|
|
// });
|
|
|
|
// Route::get('formulario', function () {
|
|
// return view('email/FormAdmin');
|
|
// })->name('formulario');
|
|
|
|
|
|
// Route::post('formulario/receive', [Pending_UserController::class, 'store'])->name('criarUser');
|
|
|
|
|
|
// Route::get('/', function () {
|
|
// return view('Admin/index');
|
|
// })->name('home');
|
|
|
|
// Route::get('formulario', function () {
|
|
// return view('email/formAdmin');
|
|
// })->name('formulario');
|
|
|
|
// Route::get('/email/notice', function (EmailVerificationRequest $request) {
|
|
// return view('auth.verify-email');
|
|
// })->middleware(['auth'])->name('verification.notice');
|