Laravel Community Tools by Tighten

Maksim Surguy

Joined: 12 years ago
Total tricks: 13
Last trick: 12 years ago

Submitted tricks

Usually you would use @section and @stop to pass data to a Blade section. When your data is limited to a short text like page title you could use the second argument of @section to pass that data.
msurguy 12 years ago 7921
Put this in your routes.php file and you will see the SQL that Eloquent is executing when you go to pages that have any sort of access to Eloquent models. This helps a lot when debugging SQL in Laravel.
msurguy 12 years ago 125642
Did you know that Laravel comes with a great amount of helpers to generate HTML in your Blade templates, like UL and OL lists, obfuscating email links, links to javascript and style assets? Check out the code below to see the HTML helpers in action.
msurguy 12 years ago 37353
When doing some sort of filtering in Eloquent, sometimes you need to use operators other than "=" and there is no easy way to know which operators you can use. This trick details the possible operators for you.
msurguy 12 years ago 23777
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 35184
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 8649
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 11255
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 20229
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 21512