For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
<?php | |
// app/filters.php | |
App::before(function($request) | |
{ | |
// get current host and replace . with _ | |
$host = str_replace('.', '_', $request->getHost()); | |
// get current config based on $host |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
body { | |
font: 13px Helvetica, Arial; | |
} |
# settings.py | |
TEMPLATE_CONTEXT_PROCESSORS = ( | |
'django.core.context_processors.i18n', | |
) | |
# urls.py (outside i18n_patterns) | |
(r'^i18n/', include('django.conf.urls.i18n')), |
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
<?php | |
use Carbon\Carbon; | |
class Comment extends Eloquent { | |
protected $guarded = array(); | |
protected $softDelete = true; | |
public static $rules = array(); |
<?php | |
// Get an array of all files in a directory. | |
$files = File::files('path_to_dir'); | |
// Get all of the files from the given directory (recursive). | |
$files = File::allFiles('path_to_dir'); | |
// Get all of the directories within a given directory. | |
$files = File::directory('path_to_dir'); |
<?php | |
// Redirect to a named 'home' route. | |
return Redirect::home(); | |
// Refresh the current URI. | |
return Redirect::refresh(); |
Linux - create "Default (Linux).sublime-mousemap" in ~/.config/sublime-text-3/Packages/User | |
Mac - create "Default (OSX).sublime-mousemap" in ~/Library/Application Support/Sublime Text 3/Packages/User | |
Win - create "Default (Windows).sublime-mousemap" in %appdata%\Sublime Text 3\Packages\User | |
[ | |
{ | |
"button": "button1", | |
"count": 1, | |
"modifiers": ["ctrl"], | |
"press_command": "drag_select", |
<?php | |
Class MyTest extends PHPUnit_Framework_TestCase { | |
static $pidfile = './.pidfile'; | |
static $serverHost = 'localhost'; | |
static $serverPort = '6767'; | |
public static function serverURL() | |
{ |
{ | |
"bold_folder_labels": true, | |
"caret_extra_width": 1, | |
"caret_style": "phase", | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme", | |
"draw_minimap_border": true, | |
"enable_tab_scrolling": false, | |
"font_face": "Inconsolata", | |
"font_options": |