Skip to content

Instantly share code, notes, and snippets.

View ci.yml
name: Run PHPUnit testsuite with mysql db
on: [push]
runs-on: ubuntu-latest
image: mysql:8.0.19
View phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi=""
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
introwit /
Last active May 25, 2019
Personally written version of Chris Fidao's video on setting up a Forge like server

Let's Log in!

  • Create ssh pair for login on a fresh DO droplet.
  • ssh into the server
  • apt-get update It updates server's knowledgeable packages. Not technically updates any software.

Alright, let's start installing our stuff boys!

  • apt-get install -y git tmux vim curl wget zip unzip htop -y flag to say yes to all prompts
  • Adding additional repositories so that we can get latest version of the softwares from this respective repositories of them:
  • For NGINX: add-apt-repository -y ppa:nginx/development (Development branch of nginx repo is actually what they consider stable because its stable + bug-fixes, its not exactly the dev branch)
  • For PHP: add-apt-repository -y ppa:ondrej/php
View LoginController.php
public function credentials(Request $request)
return [
'email' => $request->email,
'password' => $request->password,
'verified' => 1,
View CreateUsersTable.php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
* Run the migrations.
View IncludesForRC.php
namespace App\Http\Controllers\Auth;
use DB;
use Mail;
use App\User;
use Validator;
use Illuminate\Http\Request;
use App\Mail\EmailVerification;
introwit / User.php
Last active Oct 11, 2016
Email Verification blog - 6
View User.php
// Set the verified status to true and make the email token null
public function verified()
$this->verified = 1;
$this->email_token = null;
introwit / RegisterControllerVerify.php
Last active Oct 18, 2016
Email verification blog - Part 5
View RegisterControllerVerify.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
return redirect('login');
introwit / verification.blade.php
Created Oct 11, 2016
Email verification blog - part 4
View verification.blade.php
<!DOCTYPE html>
<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) {
introwit / EmailVerification.php
Last active Oct 11, 2016
Email verification blog - gist 3
View EmailVerification.php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;