Laravel Community Tools by Tighten

Recent tricks

458 tricks
On many occasions, I use the subdomain to generate dynamic routes and a custom user experience. The current Laravel subdomain filter, requires a lot of extra work when generating routes. Each time you generate a route, using the laravel route() helper, you have to pass the subdomain as the first parameter. This provides an alternative method without having to pass the subdomain to route(). https://github.com/laravel/laravel/issues/2515 for additional follow-up
jaketoolso... 11 years ago 47006
Hi ! Write your templates, controllers, ... without boring with translations. When you have finished to code, just execute the following command. It will generate and synchronise all needed files in your `lang/*/` directories. The package is available here : https://github.com/potsky/laravel-localization-helpers
potsky 11 years ago 11103
Here is how to beat Laravel to the punch when the database isn't playing nice. The error codes are specific to MySQL. You can easily substitute the error codes for whatever DB you are using. Below are 2 common errors. Here's a scrrenshot of the error page plus.google.com/113701899574492909448/posts/c4oAn7FDmLj
DragonI 11 years ago 12008
This function will allow you to forget about cache busting mechanisms. It will use your desired method of cache busting, either <filename>.<buster>.<extension> (default) or <filename>.<extension>?<buster>. You can use this to replace asset() entirely and never worry about updating those pesky cache busters whenever you update a file!
stidges 11 years ago 14343
Get a real-time view of all the currently executing queries.
mcraz 11 years ago 27383
This is my step on how to install laravel outside public_html
amirolahma... 11 years ago 29459
This is a simple macro in case you need to loop through a bunch of elements, without the need to use a foreach{}. There's support for Bootstrap class names: if your template's class attribute includes col-?-?, then this macro will add a "clear" tag to the end of each row, and also add a "row" class to the wrapper. To do (in a future release): pagination, multiple devices col- classes support.
jplozano 11 years ago 10546
4.0
I've used this technique to check if I have called any `->with()` or other relations loaded on a model. I had a need for this since I have a lot of methods that require relation data in order to generate an appended property on the model. For example, if I want to pull all of the recent Posts of an Author and I want to store it on the model as `posts_this_month`, I would need to have Posts relation loaded. I want to force myself to eager load that data before I try to access it, otherwise I could run into an n+1 problem.
chadwithuh... 11 years ago 31142
Using this package - http://csv.thephpleague.com/ In your controller or wherever you are calling this method from simply create a method like so: At the top you need to use: use League\Csv; That's about it, you should be good to go! Would like to thank @msurguy for his help on this too. - See more at: http://laravelsnippets.com/members/snippets/csv-data-manipulation-with-laravel#sthash.oqBx1dzA.dpuf
lstables 11 years ago 21507