changing fortify routes to work better with email and adding excel template for future implementation of equipment in DB.
This commit is contained in:
parent
ef5536a0d3
commit
44e0a3f373
62
app/Http/Controllers/CustomRegistrationController.php
Normal file
62
app/Http/Controllers/CustomRegistrationController.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Actions\Fortify\CreateNewUser;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
|
||||
use Illuminate\Auth\Events\Verified;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\pending_user;
|
||||
|
||||
use App\Mail\NewUserNotification;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
||||
class CustomRegistrationController extends Controller
|
||||
{
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$user = app(CreateNewUser::class)->create($request->all());
|
||||
|
||||
event(new Registered($user));
|
||||
// Chame sendEmailVerificationNotification para enviar o e-mail de verificação
|
||||
$user->sendEmailVerificationNotification();
|
||||
|
||||
// // Auth::login($user);
|
||||
|
||||
$pendingUser = pending_user::where('pending_email', $user->email)->first();
|
||||
if ($pendingUser) {
|
||||
$pendingUser->delete();
|
||||
}
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 201)
|
||||
: Redirect::to('/CreateUsers')->with('success', 'Usuário criado com sucesso, aguarda confirmacao por Email!!');
|
||||
}
|
||||
|
||||
|
||||
public function yourVerificationMethod(Request $request, $id, $hash)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
if (!hash_equals((string) $hash, sha1($user->getEmailForVerification()))) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
if ($user->markEmailAsVerified()) {
|
||||
event(new Verified($user));
|
||||
}
|
||||
|
||||
// Redirecione para a rota desejada após a verificação bem-sucedida
|
||||
return redirect()->route('CreateUsers')->with('message', 'E-mail verificado com sucesso!');
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
use App\Mail\NewUserNotification;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
use App\Models\pending_user;
|
||||
use App\Models\User;
|
||||
|
||||
class Pending_UserController extends Controller
|
||||
{
|
||||
|
|
@ -28,7 +32,7 @@ public function store(Request $request)
|
|||
$request->validate([
|
||||
'name' => 'required',
|
||||
'lastName' => 'required',
|
||||
'pending_email' => 'required|email|unique:pending_users,pending_email',
|
||||
'pending_email' => 'required|email|unique:pending_users,pending_email|unique:users,email',
|
||||
'pending_phone' => 'required',
|
||||
'pending_nif' => 'required',
|
||||
'pending_password' => 'required|min:8|confirmed',
|
||||
|
|
@ -46,6 +50,14 @@ public function store(Request $request)
|
|||
|
||||
$pendingUser->save();
|
||||
|
||||
// Enviar email de notificação para todos os Super_Administrador
|
||||
$superAdmins = User::where('user_type', 'Super_Administrador')->get();
|
||||
$newUserNotification = new NewUserNotification();
|
||||
|
||||
foreach ($superAdmins as $superAdmin) {
|
||||
Mail::to($superAdmin->email)->send($newUserNotification);
|
||||
}
|
||||
|
||||
return redirect('/formulario')->with('success', 'O seu registro foi enviado e aguarda aprovação.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
|
@ -11,17 +14,33 @@
|
|||
use Laravel\Fortify\Fortify;
|
||||
use Laravel\Fortify\Http\Controllers\AuthenticatedSessionController as FortifyAuthenticatedSessionController;
|
||||
|
||||
|
||||
use Illuminate\Auth\Events\Verified;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class userController extends Controller
|
||||
{
|
||||
public function UserProfile (){
|
||||
return view('Admin.profile');
|
||||
public function UserProfile($id)
|
||||
{
|
||||
$user = User::find($id);
|
||||
return view('Admin.profile', compact('user'));
|
||||
}
|
||||
|
||||
public function yourVerificationMethod(Request $request, $id, $hash)
|
||||
{
|
||||
$user = User::findOrFail($id);
|
||||
|
||||
if (!hash_equals((string) $hash, sha1($user->getEmailForVerification()))) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
|
||||
if ($user->markEmailAsVerified()) {
|
||||
event(new Verified($user));
|
||||
}
|
||||
|
||||
// Redirecione para a rota desejada após a verificação bem-sucedida
|
||||
return redirect()->route('CreateUsers')->with('message', 'E-mail verificado com sucesso!');
|
||||
}
|
||||
|
||||
|
||||
public function authenticate(Request $request)
|
||||
|
|
@ -40,6 +59,19 @@ public function authenticate(Request $request)
|
|||
return null;
|
||||
}
|
||||
|
||||
public static function authenticateAndRedirect(Request $request)
|
||||
{
|
||||
$user = User::where('email', $request->email)->first();
|
||||
|
||||
if ($user && Hash::check($request->password, $user->password)) {
|
||||
Auth::login($user);
|
||||
|
||||
return redirect()->route('CreateUsers');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function ListUsers()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class CheckSuperAdmin
|
|||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (auth()->user() && auth()->user()->user_type == 'Super_Administrador') {
|
||||
if (auth()->user() && auth()->user()->userType->type == 'Super_Administrador') {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
|
|
|
|||
59
app/Mail/NewUserNotification.php
Normal file
59
app/Mail/NewUserNotification.php
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class NewUserNotification extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
/**
|
||||
* Create a new message instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function build()
|
||||
{
|
||||
return $this->subject('Um novo usuário para criar')
|
||||
->view('emails.new_user_notification');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message envelope.
|
||||
*/
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: 'New User Notification',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message content definition.
|
||||
*/
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'email.new_user_notification',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the attachments for the message.
|
||||
*
|
||||
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
||||
*/
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
16
app/Models/TypeUser.php
Normal file
16
app/Models/TypeUser.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TypeUser extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany(User::class, 'user_type', 'id');
|
||||
}
|
||||
}
|
||||
|
|
@ -9,10 +9,11 @@
|
|||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
|
||||
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
class User extends Authenticatable
|
||||
// implements MustVerifyEmail
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
'user_type',
|
||||
'user_phone',
|
||||
'user_nif'
|
||||
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -49,4 +50,9 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function userType()
|
||||
{
|
||||
return $this->belongsTo(TypeUser::class, 'user_type', 'id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
use App\Http\Controllers\Auth\ResetPasswordController;
|
||||
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
||||
|
||||
// use App\http\Controllers\userController;
|
||||
|
||||
|
||||
use Laravel\Fortify\Fortify;
|
||||
|
||||
|
|
@ -49,7 +51,12 @@ public function boot(): void
|
|||
return view('auth.verify-email');
|
||||
});
|
||||
|
||||
// Fortify::authenticateUsing(function (Request $request) {
|
||||
// return UserController::authenticateAndRedirect($request);
|
||||
// });
|
||||
|
||||
|
||||
|
||||
Fortify::createUsersUsing(CreateNewUser::class);
|
||||
|
||||
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
'features' => [
|
||||
Features::registration(),
|
||||
Features::resetPasswords(),
|
||||
Features::emailVerification(),
|
||||
// Features::emailVerification(),
|
||||
|
||||
// Features::updateProfileInformation(),
|
||||
// Features::updatePasswords(),
|
||||
|
|
|
|||
BIN
public/templateExcel/FinalTemplate .xlsx
Normal file
BIN
public/templateExcel/FinalTemplate .xlsx
Normal file
Binary file not shown.
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
</div> --}}
|
||||
|
||||
|
||||
<br><br>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@
|
|||
<th>Tipo de usuário</th>
|
||||
<td>{{ $user->user_type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Telemovel</th>
|
||||
<td>{{ $user->user_phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>NIF</th>
|
||||
<td>{{ $user->user_nif }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Criado em : </th>
|
||||
<td>{{ $user->created_at }}</td>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
@extends('Templates/templateAdmin')
|
||||
|
||||
@section('Main-content')
|
||||
|
||||
<section class="content">
|
||||
<section class="content">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<!-- Card box User Profile -->
|
||||
<div class="card card-primary">
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<!-- Card box User Profile -->
|
||||
<br><br>
|
||||
<div class="card card-primary">
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm">
|
||||
<div class="user-panel mt-3 pb-3 mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-sm">
|
||||
<div class="user-panel mt-3 pb-3 mb-3">
|
||||
|
||||
<div class="image d-flex justify-content-center align-items-center">
|
||||
<div class="image d-flex justify-content-center align-items-center">
|
||||
|
||||
<label for="input-file" class="imgProfile-hover">
|
||||
<img src="{{ asset('/img/avatar5.png') }}"
|
||||
class="img-circle elevation-2 imgProfile" alt="User Image">
|
||||
<label for="input-file" class="imgProfile-hover">
|
||||
<img src="{{ asset('/img/avatar5.png') }}"
|
||||
class="img-circle elevation-2 imgProfile" alt="User Image">
|
||||
|
||||
{{-- Parte de baixo para colocar o 'Escolher arquivo' --}}
|
||||
{{-- <div class="input-group input-file">
|
||||
{{-- Parte de baixo para colocar o 'Escolher arquivo' --}}
|
||||
{{-- <div class="input-group input-file">
|
||||
<input type="text" class="form-control"
|
||||
placeholder="Escolha um arquivo" readonly>
|
||||
<span class="input-group-btn">
|
||||
|
|
@ -30,71 +30,84 @@ class="img-circle elevation-2 imgProfile" alt="User Image">
|
|||
type="button">Escolher arquivo</button>
|
||||
</span>
|
||||
</div> --}}
|
||||
|
||||
</label>
|
||||
{{-- <input type="file" id="input-file" class="d-none"> --}}
|
||||
</div>
|
||||
|
||||
|
||||
</label>
|
||||
{{-- <input type="file" id="input-file" class="d-none"> --}}
|
||||
</div>
|
||||
<div class="info text-center">
|
||||
{{-- <p class="d-block" style="font-size: 2rem;">{{ $tipo_usuario }}</p> --}}
|
||||
<div class="text-center">
|
||||
<h5>{{$user->userType->type }} :: {{$user->name}} </h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Nome: <input class="form-control" type="text" name=""></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Email: <input class="form-control" type="text" name=""></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Telemovel: <input class="form-control" type="text" name=""></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>NIF: <input class="form-control" type="text" name=""></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
{{-- <p>Nova Senha: <input class="form-control" type="text" name=""></p> --}}
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<a href="" class="btn btn-primary">Redefinir Senha</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info text-center">
|
||||
{{-- <p class="d-block" style="font-size: 2rem;">{{ $tipo_usuario }}</p> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card-body -->
|
||||
<div class="col-sm">
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Nome: <input class="form-control" type="text" name="" value="{{$user->name}}"></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Email: <input class="form-control" type="text" name="" value="{{$user->email}}"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Telemovel: <input class="form-control" type="text" name="" value="{{$user->user_phone}}"></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>NIF: <input class="form-control" type="text" name="" value="{{$user->user_nif}}"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- <div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Senha : <input class="form-control" type="password" ></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm form-group align-self-center">
|
||||
<p>Confirmar Senha : <input class="form-control" type="password" ></p>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm form-group align-self-center">
|
||||
{{-- <p>Nova Senha: <input class="form-control" type="text" name=""></p> --}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
<button type="submit" class="btn btn-primary">Guardar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
<!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="float-right">
|
||||
<button type="submit" class="btn btn-primary">Guardar</button>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-danger">Logout</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.card -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{{-- ./container-fluid" --}}
|
||||
</section>
|
||||
{{-- ./content --}}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{{-- ./container-fluid" --}}
|
||||
</section>
|
||||
{{-- ./content --}}
|
||||
</div>
|
||||
{{-- ./content-wrapper --}}
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -86,8 +86,10 @@ class="fas fa-bars"></i></a>
|
|||
</div>
|
||||
<div class="info">
|
||||
@if (Auth::check())
|
||||
<a href="{{ route('usersProfiles')}}" class="d-block">{{ Auth::user()->user_type }}
|
||||
</a>
|
||||
{{-- <a href="{{ route('usersProfiles',['id' => Auth::user()->id] )}}" class="d-block">{{ Auth::user()->user_type }}
|
||||
</a> --}}
|
||||
<a href="{{ route('usersProfiles',['id' => Auth::user()->id] )}}" class="d-block">{{ Auth::user()->userType->type }}</a>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -125,12 +127,7 @@ class="fas fa-bars"></i></a>
|
|||
</a>
|
||||
</li>
|
||||
|
||||
{{-- <li class="nav-item">
|
||||
<form method="POST" action="{{ route('logout') }}">
|
||||
@csrf
|
||||
<button type="submit" class="nav-link active">Logout</button>
|
||||
</form>
|
||||
</li> --}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
<div class="input-group mb-3">
|
||||
<input type="email" name="email" class="form-control" placeholder="Utilizador" id="email" placeholder="email">
|
||||
{{-- <input type="text" name="user_nif" id="user_nif" class="form-control" value="{{ old('user_nif') }}" required autofocus> --}}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
|
|
@ -52,6 +53,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- ... -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<body>
|
||||
<h1>Olá!</h1>
|
||||
<p>Segue abaixo o link para acessar o formulário:</p>
|
||||
<a href="{{ url('/CreateUser') }}" target="_blank" style="background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer;">Acessar Formulário</a>
|
||||
<a href="{{ route('formulario') }}" target="_blank" style="background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer;">Acessar Formulário</a>
|
||||
<p>Se você não solicitou este e-mail, por favor, desconsidere.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
12
resources/views/email/new_user_notification.blade.php
Normal file
12
resources/views/email/new_user_notification.blade.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Um novo usuário para criar</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Olá,</p>
|
||||
<p>Um novo usuário foi registrado e está aguardando aprovação.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
@section('Main-content')
|
||||
<br><br>
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h3 class="card-title mb-0">Enviar Formulário:</h3>
|
||||
|
|
@ -13,13 +19,13 @@
|
|||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="form-group">
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" class="form-control" name="email" required>
|
||||
<p for='email'>Email
|
||||
<input type="email" class="form-control" name="email" required>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="submit" class="btn btn-primary">Enviar</button>
|
||||
|
||||
<div class="col-sm-4 text-center">
|
||||
<button style="width:30%;height:90%;" type="submit" class="btn btn-primary">Enviar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -37,7 +43,7 @@
|
|||
<table class="table table-bordered table-striped justify-content-center">
|
||||
<thead class="text-center">
|
||||
<tr>
|
||||
<th>Numero</th>
|
||||
<th>Id</th>
|
||||
<th>Nome</th>
|
||||
<th>Email</th>
|
||||
<th>Verificar</th>
|
||||
|
|
|
|||
|
|
@ -19,10 +19,31 @@
|
|||
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');
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -45,17 +66,7 @@
|
|||
return view('Admin/index');
|
||||
})->name('home');
|
||||
|
||||
// Route::get('/', function () {
|
||||
// return view('Admin/index');
|
||||
// })->name('home');
|
||||
|
||||
// Route::get('formulario', function () {
|
||||
// return view('email/formAdmin');
|
||||
// })->name('formulario');
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create Users with Super Admin
|
||||
|
|
@ -66,19 +77,8 @@
|
|||
| be assigned to the "web" middleware group. Make something great!
|
||||
|
|
||||
*/
|
||||
|
||||
});
|
||||
|
||||
// Route::get('formulario', function () {
|
||||
// return view('email/FormAdmin');
|
||||
// })->name('formulario');
|
||||
|
||||
|
||||
// Route::post('formulario/receive', [Pending_UserController::class, 'store'])->name('criarUser');
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User_Type (Super_Administrador)
|
||||
|
|
@ -88,16 +88,7 @@
|
|||
|
|
||||
*/
|
||||
Route::middleware(['auth', 'verified', 'checksuperadmin'])->group(function () {
|
||||
|
||||
|
||||
|
||||
// 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('usersProfiles', [userController::class, 'UserProfile'])->name('usersProfiles');
|
||||
Route::get('usersProfiles/{id}', [userController::class, 'UserProfile'])->name('usersProfiles');
|
||||
Route::post('enviar-formulario', [FormController::class, 'enviarEmail'])->name('enviar.formulario');
|
||||
|
||||
/*
|
||||
|
|
@ -127,21 +118,21 @@
|
|||
*/
|
||||
Route::get('/CreateUsers', [Pending_UserController::class, 'ListPendingUsers'])->name('CreateUsers');
|
||||
|
||||
Route::get('/CreateUsers/{id}',[Pending_UserController::class, 'ShowFormUser'])->name('ShowPendingUser');
|
||||
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 () {
|
||||
|
|
@ -157,4 +148,24 @@
|
|||
// } 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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user