Skip to content

Instantly share code, notes, and snippets.

@systemseven
systemseven / style.css
Created June 14, 2013 12:44
How to proportionally scale images that have dimension attributes
img {
width:auto;
max-width:100%;
height:auto;
}
@systemseven
systemseven / routes.php
Created June 12, 2013 14:41
This puts /api/v1 in front of all controller requests. Sort of like route grouping. Useful for API development. If api is updated you can create a v2 grouping
// Route group for API versioning
Route::group(array('prefix' => 'api/v1', 'before' => 'auth.basic'), function()
{
Route::resource('url', 'UrlController');
Route::resource('user','UserController');
});
@systemseven
systemseven / model.php
Created June 12, 2013 13:50
Soft Deletes in Laravel 4
//in the model
class User extends Eloquent {
protected $softDelete = true;
}
//in the migration, to create a soft delete column
$table->softDeletes();