Laravel Community Tools by Tighten

Recent tricks

458 tricks
If you have an API, which you also use on your site..then you might want to get the data from the API by making an internal request.
xtrasmal 12 years ago 19009
Check if the request matches the url. If so, add an active class to the menu item.
xtrasmal 12 years ago 12463
Use this trick to log queries using Monolog. Add this to your routes.php and log straight into your Firebug console. Firebug needs the FirePHP add-on. - kisses Netbulae
xtrasmal 12 years ago 12604
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 11242
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 13808
A Link assets based on which controller is currently requested. Any improvements to this code are welcome
JonathanFr... 12 years ago 11677
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 8698
4.1
Laravel 4 have a lot of features some hidden :) for some developers, i found the option to run artisan commands from route or controller, like Artisan::call('migrate:install'); or Artisan::call('migrate', [ '--path'=>'app/database/migrations' ]); Artisan::call('db:seed'); it is usefull when you don't have access to the console in share hosting environments.
Bradley 12 years ago 87402
4.0
If you find out, that your blade template is empty and no error message generated: double check your comments
mring 12 years ago 8372