Skip to content

Instantly share code, notes, and snippets.

@m-maranan
m-maranan / create_vhost.sh
Created March 26, 2014 20:33
Create a Virtual Host for a New Site
#!/bin/bash
# run with sudo create_vhost
# replace {path to public} eg /var/www/laravel/public
# Create the file with VirtualHost configuration in /etc/apache2/site-available/
echo "<VirtualHost *:80>
DocumentRoot {path to public}
ServerName lawfirmrater.dev
<Directory {path to public}>
@m-maranan
m-maranan / gist:9652089
Created March 19, 2014 21:46
Error And Exception Example
// this is how we catch the Runtime Exception
// file : error.php
App::error(function(RuntimeException $exception)
{
// Runtime Errors
return "Runtime Error : ". $exception->getMessage();
});
@m-maranan
m-maranan / gist:9651711
Created March 19, 2014 21:25
errors.php
<?php
App::error(function(Exception $exception)
{
// Server Side Errors. Displays Error Message
return 'Server Error : '.$exception->getMessage();
});
App::error(function(RuntimeException $exception)
{
// Runtime Errors
@m-maranan
m-maranan / gist:9237872
Created February 26, 2014 20:30
Routes.php
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
#!/usr/bin/env bash
echo -e "Configure DocumentRoot to /var/www/public"
# Setup hosts file
VHOST=$(cat <<EOF
<VirtualHost *:80>
DocumentRoot "/var/www/public"
ServerName lawfirmrater.dev
<Directory "/var/www/public">
#!/usr/bin/env bash
# Configurable variables
database='vagrant'
username='vagrant'
password='vagrant'
echo ''
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ' Bootstrapping Ubuntu Precise 32bit for Laravel 4'