Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remind to verify email #30 #54

Merged
merged 3 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions app/Console/Commands/createUsefulLink.php

This file was deleted.

45 changes: 0 additions & 45 deletions app/Console/Commands/sendEmailVerification.php

This file was deleted.

16 changes: 15 additions & 1 deletion resources/views/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class="float-right text-muted text-sm">{{$notification->created_at->longAbsolute
</ul>
</nav>
<!-- /.navbar -->

<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-open sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
Expand Down Expand Up @@ -273,7 +272,22 @@ class="nav-link @if(Request::routeIs('admin.usefullinks.*')) active @endif">
</aside>

<!-- Content Wrapper. Contains page content -->

<div class="content-wrapper">

@if(!Auth::user()->hasVerifiedEmail())
@if(Auth::user()->created_at->diffInHours(now(), false) > 2)
<div class="alert alert-warning p-2 m-2">
<h5><i class="icon fas fa-exclamation-circle"></i> Warning!</h5>
You have not yet verified your email address <a class="text-primary"
href="{{route('verification.send')}}">Click here to
resend
verification email</a> <br>
Please contact support If you didn't receive your verification email.
</div>
@endif
@endif

@yield('content')
</div>
<!-- /.content-wrapper -->
Expand Down
14 changes: 9 additions & 5 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\ServerController;
use App\Http\Controllers\StoreController;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
Expand All @@ -35,14 +37,16 @@
return redirect('login');
})->name('welcome');

Route::get('/terms', function () {
return view('terms');
})->name('terms');


Auth::routes(['verify' => true]);

Route::middleware('auth')->group(function () {
#resend verification email
Route::get('/email/verification-notification', function (Request $request) {
$request->user()->sendEmailVerificationNotification();

return back()->with('success', 'Verification link sent!');
})->middleware(['auth', 'throttle:3,1'])->name('verification.send');

#normal routes
Route::resource('notifications', NotificationController::class);
Route::resource('servers', ServerController::class);
Expand Down