Skip to content

Instantly share code, notes, and snippets.

@IlyaZha
IlyaZha / create_host.sh
Created December 20, 2016 09:49
Create host for laravel-project for Ubuntu.
#!/bin/bash
#Create project folders first. Than run this script
parametr1=$1
projectPath=/home/userName/PhpstormProjects
cp /etc/nginx/example.conf /etc/nginx/conf.d/$parametr1.conf
rpl -iqR example $parametr1 /etc/nginx/conf.d/$parametr1.conf
sed -i -e '1 s/^/127.0.0.1 '$parametr1'.local\n/;' /etc/hosts
service nginx restart
chown www-data $projectPath/$parametr1/bootstrap/cache/
@IlyaZha
IlyaZha / gist:a72ea944f1fb7daebbee9bbcefb97399
Last active December 13, 2016 12:00 — forked from drakakisgeo/gist:3bba2a2600b4c554f836
Auto trim all input [Laravel 5]
// Step 1. Create this class in the middleware folder (/app/Http/Middleware).
<?php
namespace App\Http\Middleware;
use Closure;
class BeforeAutoTrimmer {