Laravel Community Tools by Tighten

Recent tricks

458 tricks
Loading views from a different location, other than 'app/views'
Whyounes 11 years ago 9530
With this trick you will able to unitTest complex query, that will have closures.
fenos 11 years ago 15255
I recently figured out that you can specify the columns that you want to select from an eager loaded relationship in Eloquent. I thought others might find this useful as I couldn't find much about this online!
stidges 11 years ago 41997
sometime we need to autocomplete one input area and based on the value of this input area we sometime populated a dynamic dropdown . I thought it worth sharing .
hassanjama... 11 years ago 35597
How to update many-to-many relationship
nihaoit 11 years ago 15066
I happened across a function in Laravel's Command class. This command is Command::table(); Have you ever wanted to build a table in the same fashion that the 'routes' command does? Well, this function is how to do it! I couldn't find any real documentation on the method so just had a quick tinker with it and figured out it's usage. Here is an example of how to use it. Hopefully this might give the function some exposure, because at the moment, the web is lacking any!
Azirius 11 years ago 9100
Ever wanted to route pretty SEO urls to a controller with a specific ID without having to query the DB every time to match the URL to the page? On a number of projects previously, I've created cached versions of route files so that we can save all the URLs for a site and cut down on DB queries to work out what item we're viewing. Create another routes file that you write to whenever an entry is saved. You may end up with a lot of entries in the file, as each route will be for an individual item. Pass the ID to your controller action via the route like so:
Brunty 11 years ago 12809
4.1
If you’re using blade, you can use the following to easily output style and script tags.
hengkiardo 11 years ago 8332
Generating A Drop-Down List
vjmani22 11 years ago 9355
4.0