Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
#!/bin/bash | |
# Setup a debian based vagrant machine | |
TO_CLEAN_PKGS=() | |
nullify_free_space() { | |
echo 'clearing free space' | |
dd if=/dev/zero of=/EMPTY bs=1M | |
rm -f /EMPTY | |
} |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/usr/bin/env perl | |
use Modern::Perl; | |
use autodie; | |
use warnings; | |
use threads; | |
use Thread::Queue qw( ); | |
use Getopt::Long; | |
require LWP::UserAgent; | |
use Benchmark; |
install_ruby() { | |
# install dependencies | |
apt-get -y install zlib1g-dev libssl-dev libc6-dev libncurses5-dev | |
# due to problems on openssl on debian based distributions, install the | |
# openssl package from tvm and point to this location using the configure | |
# flags | |
# | |
# install rvm | |
apt-get -y install curl |
#!/bin/bash | |
# exit script if not run as root | |
if [[ $EUID -ne 0 ]]; then | |
cat <<END | |
you need to run this script as the root user' >&2 | |
use :privileged => true in Vagrantfile | |
END | |
exit 1 |
locales | |
|-- admin | |
| |-- en-US.l20n | |
| `-- nl-NL.l20n | |
`-- manifest.json |
#!/bin/bash | |
onRemote() { | |
vagrant ssh -c "cd /var/www; $*" | |
} | |
cd "$(git rev-parse --show-toplevel)/www" | |
vagrant up --provision | |
npm install | |
bower install | |
grunt clean && grunt all |
#!/bin/bash | |
onRemote() { | |
vagrant ssh -c "cd /var/www; $*" | |
} | |
cd "$(git rev-parse --show-toplevel)/www" | |
vagrant up --provision | |
npm install | |
bower install | |
grunt all |
#!/bin/bash | |
onRemote() { | |
vagrant ssh -c "cd /var/www; $*" | |
} | |
cd "$(git rev-parse --show-toplevel)/www" | |
vagrant up --provision | |
npm install | |
bower install | |
grunt all |