Laravel Community Tools by Tighten

Recent tricks

458 tricks
about using the CSRF filter in your forms. Often you will want to apply a filter to many routes. Instead of attaching the filter to each individual route, you can assign it to many routes at the same time as a group:
arduino731 11 years ago 7440
4.2
The URL rewriting in Windows IIS is via a configuration xml file located in the site root with the name of web.config. The code below abilita and does the same paper apache .htaccess, just copy the code below and paste it in your web.config file by saving it in the folder public / project, assuming you've directed your root directory to public /, everything should work fine!
ggwebdev 11 years ago 24319
4.2
I've put the full namespaces in for science.
orlissenbe... 11 years ago 8497
Filter for minify html output. Put this code into \app\filters.php
gulch 11 years ago 26492
Hi, I got the example by Dastan Turysbekov (http://laravelsnippets.com/snippets/menu-activated) and changed a little bit. It's a simple Macro to use with Active Menu. You can use parameters and attributes as well.
marcelofer... 11 years ago 9966
Simply add the following lines to ./app/start/global.php at the "Application Error Handler" - Section there is no need to touch the "CSRF Protection Filter" at all.
etenzy 11 years ago 20976
Until Taylor makes it part of Homestead, here's one way to add SSL support for your dev sites. Plenty of room for improvement, so please add your ideas. For example, generating the ssl certs in the loop, instead of including them.
jhauraw 11 years ago 24072
A variation of http://www.laravel-tricks.com/tricks/column-selection-in-eager-loading Credits: http://stackoverflow.com/questions/16994253/laravel-eager-loading-load-only-specific-columns Warning: this trick does not work on many-to-many relations, see: https://github.com/laravel/framework/issues/2966
orlissenbe... 11 years ago 18895
Sometimes you need to add a new column to a table that already exists, for this we can use laravel migrations. In our command line we type (You can name the migration file as you want ) : php artisan migrate: make add_field_to_table. In line 14 we're adding a new field (table column) into our table. We type the field type if you don't know the field types you can find them in the documentation: http://laravel.com/docs/4.2/schema. Continuing with, we can specified if we want to add the field before or after an a column that already exists of course. In this case i'm using after but you should use whatever you need. Once we have finish, we go back to the command line we type: php artisan migrate. And that's it, we've updated our table. I guess that we can add as many fields as we need, i didn't try that but i think that it will works too. Cheers!
selenearzo... 11 years ago 31714