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
<?php | |
/* This sets the $time variable to the current hour in the 24 hour clock format */ | |
$time = date("H"); | |
/* Set the $timezone variable to become the current timezone */ | |
$timezone = date("e"); | |
/* If the time is less than 1200 hours, show good morning */ | |
if ($time < "12") { | |
echo "Good morning"; | |
} else | |
/* If the time is grater than or equal to 1200 hours, but less than 1700 hours, so good afternoon */ |
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
<?php | |
/** | |
* Create a new user instance after a valid registration with a random email token | |
* | |
* @param array $data | |
* @return User | |
*/ | |
protected function create(array $data) | |
{ |
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
<?php | |
/** | |
* Over-ridden the register method from the "RegistersUsers" trait | |
* Remember to take care while upgrading laravel | |
*/ | |
public function register(Request $request) | |
{ | |
// Laravel validation | |
$validator = $this->validator($request->all()); |
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
<?php | |
namespace App\Mail; | |
use App\User; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Mail\Mailable; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Contracts\Queue\ShouldQueue; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<style type="text/css" rel="stylesheet" media="all"> | |
/* Media Queries */ | |
@media only screen and (max-width: 500px) { |
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
<?php | |
// Get the user who has the same token and change his/her status to verified i.e. 1 | |
public function verify($token) | |
{ | |
// The verified method has been added to the user model and chained here | |
// for better readability | |
User::where('email_token',$token)->firstOrFail()->verified(); | |
return redirect('login'); |
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
<?php | |
// Set the verified status to true and make the email token null | |
public function verified() | |
{ | |
$this->verified = 1; | |
$this->email_token = null; | |
$this->save(); | |
} |
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
<?php | |
namespace App\Http\Controllers\Auth; | |
use DB; | |
use Mail; | |
use App\User; | |
use Validator; | |
use Illuminate\Http\Request; | |
use App\Mail\EmailVerification; |
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
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateUsersTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
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
<?php | |
public function credentials(Request $request) | |
{ | |
return [ | |
'email' => $request->email, | |
'password' => $request->password, | |
'verified' => 1, | |
]; | |
} |
OlderNewer