Skip to content

Instantly share code, notes, and snippets.

@Jhhames
Jhhames / courseherd.html
Created January 17, 2019 06:14
Courseherd Acount Settings Page
<section class="bg-white py-4">
<div class="container">
<h1 class="font-weight-bold">Account Settings</h1>
<div class="row bg-light p-3 border border">
<div class="card w-100 rounded rounded-2">
<div class="card-header font-weight-bold bg-white">
My Account
</div>
<div class="card-body">
<button class="btn btn-danger">Deactivate Account <span class="fa fa-trash "></span> </button>
<?php
namespace App\Http\Middleware;
use Closure;
use App\Reward;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class RewardMiddleware
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<section class="mt-5">
<div class="container">
<h2 class="title m-b-md text-center">
Laravel
</h2>
<div class="row justify-content-center">
<div class="col-md-6">
<form action="{{ route('form.submit') }}" method="POST">
@csrf
<div class="form-group">
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
<script>
toastr.options.closeButton = true;
@if(Session::has('error'))
toastr.error("{{ Session::get('error') }}",'',{timeOut: 4000});
@endif;
@if(Session::has('success'))
// Display a warning toast, with no title
toastr.warning('My name is Inigo Montoya. You killed my father, prepare to die!')
// Display a success toast, with a title
toastr.success('Have fun storming the castle!', 'Miracle Max Says')
// Display an error toast, with a title
toastr.error('I do not think that word means what you think it means.', 'Inconceivable!')
// Immediately remove current toasts without using animation
<?php
use Illuminate\Support\Facades\URL;
public function __construct(){
// Force SSL in production
if (config('app.env') == 'production') {
URL::forceScheme('https');
}
@Jhhames
Jhhames / config.php
Last active May 12, 2019 21:26
Code snippet for 'pgsql' connection when working with DATABASE_URL
<?php
$herokuDb = parse_url(env('DATABASE_URL', "postgres://uiozlihhyedqxs:f07e3c07c2cbe0a255da5fe2051bfaf9926efca2c92fa13094f1b2b58bb49ece@ec2-54-235-208-103.compute-1.amazonaws.com:5432/df4dvi3c63i7pb"));
.
.
.
'pgsql' => [
'driver' => 'pgsql',
'host' => $herokuDb['host'],
'database' => substr($herokuDb['path'], 1),