Skip to content

Instantly share code, notes, and snippets.

View mewebstudio's full-sized avatar

MeWebStudio - Muharrem ERİN mewebstudio

View GitHub Profile
@mewebstudio
mewebstudio / laravel.js
Created May 21, 2016 18:50 — forked from soufianeEL/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
about
access
account
accounts
add
address
adm
admin
administration
adult

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@mewebstudio
mewebstudio / after.sh
Created April 8, 2015 10:30
~/.homestead/after.sh
#!/usr/bin/env bash
# Populate this array with each of your dev site hostnames.
sites_hosts=( homestead.app ) # array, e.g., www.example.dev
# Config for SSL.
SSL_DIR="/etc/nginx/ssl"
PASSPHRASE="secret"
SUBJ="
C=BE
@mewebstudio
mewebstudio / after.sh
Last active August 29, 2015 14:18 — forked from cluppi/after.sh
#!/bin/sh
# Config for SSL.
echo "--- Making SSL Directory ---"
mkdir /etc/nginx/ssl
echo "--- Copying $i SSL crt and key ---"
openssl req -nodes -new -x509 -keyout /etc/nginx/ssl/server.key -out /etc/nginx/ssl/server.crt -subj "/C=US/ST=NY/L=NYC/O=Dis/CN=www.example.com"
echo "--- Turning SSL on in nginx.conf. ---"

Using phpMyAdmin with Homestead box

Once the Homestead vagrant box is installed successfully, we can add phpMyAdmin and config it to run with Nginx.

Install phpMyAdmin

  • SSH into Homestead vagrant box with vagrant ssh and type the following command:
    sudo apt-get install phpmyadmin

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using: