Skip to content

Instantly share code, notes, and snippets.

View ci.yml
name: Run PHPUnit testsuite with mysql db
on: [push]
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.19
View phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
@introwit
introwit / forgeLikeServerSetup.md
Last active May 25, 2019
Personally written version of Chris Fidao's video on setting up a Forge like server
View forgeLikeServerSetup.md

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
<?php
public function credentials(Request $request)
{
return [
'email' => $request->email,
'password' => $request->password,
'verified' => 1,
];
}
View CreateUsersTable.php
<?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
<?php
namespace App\Http\Controllers\Auth;
use DB;
use Mail;
use App\User;
use Validator;
use Illuminate\Http\Request;
use App\Mail\EmailVerification;
@introwit
introwit / User.php
Last active Oct 11, 2016
Email Verification blog - 6
View User.php
<?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();
}
@introwit
introwit / RegisterControllerVerify.php
Last active Oct 18, 2016
Email verification blog - Part 5
View RegisterControllerVerify.php
<?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');
@introwit
introwit / verification.blade.php
Created Oct 11, 2016
Email verification blog - part 4
View verification.blade.php
<!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) {
@introwit
introwit / EmailVerification.php
Last active Oct 11, 2016
Email verification blog - gist 3
View EmailVerification.php
<?php
namespace App\Mail;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;