Laravel Community Tools by Tighten

Tag "4.1" tricks

72 tricks
Laravel passes 100% test coverage on Hip Hop Virtual Machine (HHVM) so you might want to try using it to host your next Laravel application. The advantage of HHVM is an increase in speed of executing your PHP scripts and thus boosting your application. This config was provided by Taylor Otwell.
msurguy 12 years ago 21505
An easy helper method that will assist in setting active classes for navigation items based on the current route.
mattems 12 years ago 27616
What if instead of using debugging bar like https://github.com/barryvdh/laravel-debugbar or others, you could use something that integrates directly with Chrome's web developer tools? Imaging viewing request information, headers, get and post data, cookies, session data, DB queries, routes and timing, all within Chrome's developer tools panel? With this extension, you can! Read the instructions below to know how!
msurguy 12 years ago 20220
Previously, if you wanted to output a default value of a string in Blade you would put a condition that checks if the variable is set, otherwise defaults to some value. Now you can shorten the code by using the keyword "or" to specify what should be displayed if the variable is not set.
msurguy 12 years ago 11249
When you're into making an API, you may wish to make the format of the responses you provide dynamic. If you're not using controllers, you would make a class, but if you use controllers, it's a pretty good idea to place it in the base controller. As well you may restructure your response data to include more fields, e.g. for testing purposes you may wish to also include some custom debug.
vlakarados 12 years ago 13826
Nice quick one-liner to prep your system for superquick installs using the new PHP Archive installer in Laravel 4.1. More details in the blog post: http://bit.ly/1mt4Weu
dshoreman 12 years ago 8707
4.1
Sometimes the compiled file could get corrupted and not function properly, breaking your Laravel installation. This is a list of steps you could use trying to fix a Laravel installation that previously worked just fine on a server.
msurguy 12 years ago 8645
I have added a sitemap to this very site and was thinking that some of you want to do the same for SEO purposes. The way to add a sitemap would be pretty easy by using a Blade template for the XML that sitemap requires but there is an easier solution. You can use a package from https://github.com/RoumenDamianoff/laravel4-sitemap that would make it super simple to generate a sitemap for your Laravel application. See for yourself.
msurguy 12 years ago 35174
This trick is what we use to make writing controllers very quick and easy. The base controller has methods plugged in where needed to automatically load views to a set of templates on it's own. All you need to do is pass it the data you want displayed. It also handles missingmethod to automatically look for logical views. Let me know what you think or any ideas for improving upon it. As a note, I use a separate controller to set the page title and menu items.
stygian 12 years ago 14652