The easiest way to setup docker for Symfony or Laravel

Docker is a handy tool to setup multiple light-weight development environments or to virtualize your server. Too bad, docker has a steep learning curve and demands you to know some…

Read more »

Laravel Route Pattern For Whole Word

If you want to match an entire word in a route pattern for Laravel 4, use the underneath snippet. Route::pattern('my_word_pattern', '^myword$'); Route::get('{my_word_pattern}/…

Read more »

Laravel form array validation, array_size, required_if

I spent a crazy amount of time on figuring out how to validate form arrays in Laravel. There is some official documentation, but like most official documentation of Laravel, it…

Read more »

Laravel Migrations: how to drop a foreign key column

Sometimes it can be desirable to remove a database column that hosts a foreign key relationship (eg: in reverse migration scripts). It can be a bit of a hassle to…

Read more »

Laravel: autocomplete for $table in migration scripts

A quick tip: if you want autocomplete (intellisense) when writing migrations in Laravel, you can add type hinting for the $table variable. Just add Blueprint before $table in the function…

Read more »

What does ‘composer dump-autoload’ do in Laravel?

Composer is a major part of the Laravel MVC Framework, but it also exists without Laravel. In fact you could use it in any project. This article digs into the…

Read more »

Laravel: passing data with Mail:queue() to a view

Mail:send() and Mail:queue() don’t work the same when it comes to passing $data to a view. At least not when you’re passing an eloquent object (or a “model” object). Eg:…

Read more »

Laravel and Varnish: admin interface with cookies and public pages without cookies

If you want Laravel to show cached content from Varnish on public pages (so without a cookie), but still want to use a cookie on admin pages, and switch between…

Read more »

Laravel use Memcache instead of MemcacheD

Laravel works out of the box with Memcached. However there’s a difference between the linux programs Memcached and Memcache (without the D). To get Laravel to work with Memcache you…

Read more »

Laravel 4: pivot table example (attach and detach)

What’s a pivot table? A pivot table is a database table that only exists to serve a many-to-many relationship. Say you have a table “customer” and a table “drinks”. If…

Read more »