Skip to content

Instantly share code, notes, and snippets.

View lawdoc71's full-sized avatar
🎯
Focusing

Michael lawdoc71

🎯
Focusing
View GitHub Profile
@lawdoc71
lawdoc71 / MarketingImageController.php
Created October 9, 2018 17:08 — forked from evercode1/MarketingImageController.php
chapter 10 5.2 MarketingImageController.php
<?php
namespace App\Http\Controllers;
use App\Traits\ManagesImages;
use App\Http\Requests\CreateImageRequest;
use App\MarketingImage;
use App\Http\Requests\EditImageRequest;
class MarketingImageController extends Controller
@lawdoc71
lawdoc71 / CreateImageRequest.php
Created October 9, 2018 17:04 — forked from evercode1/CreateImageRequest.php
Chapter 10 Create Image Request
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateImageRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
@lawdoc71
lawdoc71 / create.blade.php
Created October 8, 2018 23:50 — forked from evercode1/create.blade.php
Chapter 10 Create Form Marketing Images
@extends('layouts.master')
@section('title')
<title>Create a Marketing Image</title>
@endsection
@section('content')
@lawdoc71
lawdoc71 / up.method
Created October 8, 2018 23:47 — forked from evercode1/up.method
chapter 10 up method
public function up()
{
Schema::create('marketing_images', function(Blueprint $table)
{
$table->increments('id');
$table->boolean('is_active')->default(false);
$table->boolean('is_featured')->default(false);
$table->string('image_name')->unique();
$table->string('image_extension', 10);
$table->timestamps();
@lawdoc71
lawdoc71 / ManagesImages.php
Created October 8, 2018 23:42 — forked from evercode1/ManagesImages.php
Chapter 10 5.2 ManagesImages trait
<?php
namespace App\Traits;
use Illuminate\Support\Facades\Config;
use Intervention\Image\Facades\Image;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\File;
trait ManagesImages
@lawdoc71
lawdoc71 / image-defaults.php
Created October 8, 2018 23:37 — forked from evercode1/image-defaults.php
Chpater 10 5.2 image-defaults.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Image Paths and Settings
|--------------------------------------------------------------------------
|
|
@lawdoc71
lawdoc71 / deploy.sh
Created October 2, 2018 23:55 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
git pull origin master
# Install/update composer dependecies
@lawdoc71
lawdoc71 / Laravel PHP7 LEMP AWS.md
Created September 22, 2018 08:39 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@lawdoc71
lawdoc71 / Virtual Blocks on Nginx.md
Created September 22, 2018 08:39 — forked from santoshachari/Virtual Blocks on Nginx.md
Setup additional sites on Nginx

Inspired and edited from this Digital Ocean tutorial.

Follow the steps on this gist to setup a LEMP stack with PHP 7.0.

The steps assume Nginx has been configured correctly.

Setup the root directories

For the domains example.com and test.com, create the folders.

@lawdoc71
lawdoc71 / Checklist.md
Created September 22, 2018 03:08 — forked from derrekbertrand/Checklist.md
Security Checklist for using Laravel on Digital Ocean's LEMP app

Security Checklist

For setting up laravel on Ubuntu 14.04. Assumes using DO's LEMP image to start.

To start:

  • Install and update new software:
    • Run apt-get update
  • Run apt-get install php5-cli php5-mcrypt git