-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from xPand4B/v1.1.1
V1.1.1
- Loading branch information
Showing
45 changed files
with
1,146 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
APP_NAME=MiPa-Pool | ||
BRAND_ICON= | ||
|
||
APP_KEY= | ||
|
||
# Database Credentials | ||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
# Mail Settings | ||
MAIL_DRIVER=smtp | ||
MAIL_HOST=YOUR_EMAIL_HOSTER | ||
MAIL_PORT=465 | ||
MAIL_USERNAME=YOUR_EMAIL_ADDRESS | ||
MAIL_PASSWORD=YOUR_EMAIL_PASSWORD | ||
MAIL_ENCRYPTION= | ||
MAIL_FROM_ADDRESS=SPECIFY_EMAIL_ADDRESS | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=eu | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Auth; | ||
use Closure; | ||
use Illuminate\Support\Facades\Log; | ||
use App\Notifications\AddEmailNotification; | ||
|
||
class CheckIfEmailExists | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Closure $next | ||
* @return mixed | ||
*/ | ||
public function handle($request, Closure $next) | ||
{ | ||
if ($user = Auth::user()) { | ||
if (! isset($user->email)) { | ||
if ($user->notifications->where('type', 'App\Notifications\AddEmailNotification')->count() == 0 ) { | ||
$user->notify(new AddEmailNotification($user->id)); | ||
Log::info("User #".Auth::user()->id." has received the 'AddEmail' notification."); | ||
} | ||
}else{ | ||
if ($user->notifications->where('type', 'App\Notifications\AddEmailNotification')->count() == 1 ) { | ||
$user->notifications->where('type', 'App\Notifications\AddEmailNotification')->first()->markAsRead(); | ||
} | ||
} | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Mail\Auth; | ||
|
||
use Carbon\Carbon; | ||
use App\Models\User; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use App\MiPaPo\Mail\MiPaPoMailer; | ||
use Illuminate\Support\Facades\Log; | ||
use Illuminate\Support\Facades\URL; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
|
||
class EmailVerificationMail extends Mailable implements ShouldQueue | ||
{ | ||
use Queueable, SerializesModels, MiPaPoMailer; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(User $user) | ||
{ | ||
$this->user = $user; | ||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
$verifyUrl = URL::temporarySignedRoute( | ||
'verification.verify', | ||
Carbon::now()->addMinutes(config('auth.verification.expire', 60)), | ||
['id' => $this->user->id] | ||
); | ||
|
||
$mail = $this | ||
->subject(trans('mail.verify.subject')) | ||
->introLines([ | ||
trans('mail.verify.line') | ||
]) | ||
->action(trans('mail.verify.action'), $verifyUrl) | ||
->markdown('mails.default'); | ||
|
||
Log::info("User #".$this->user->id." has requested an 'verify email' email."); | ||
|
||
return $mail; | ||
} | ||
} |
Oops, something went wrong.