Skip to content

Instantly share code, notes, and snippets.

@newpain01
newpain01 / eloquent.md
Created April 3, 2017 10:44 — forked from msurguy/eloquent.md
Laravel 4 Eloquent Cheat Sheet.

Conventions:

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';

@newpain01
newpain01 / gist:a7c55244dff13c2b4f2e998ec62ccf31
Created January 16, 2017 02:58 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration