Laravel Community Tools by Tighten

Tag "4.2" tricks

24 tricks
When validating data belonging to multiple models you might be missing errors if you run your validators one by one. This simple trick combines validators and their errors.
The Saint... 11 years ago 16616
4.2
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 7441
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 24324
4.2
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 9971
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 20981
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 31716