Laravel Community Tools by Tighten

Recent tricks

458 tricks
Loading views from a different location, other than 'app/views'
Whyounes 12 years ago 9708
With this trick you will able to unitTest complex query, that will have closures.
fenos 12 years ago 15447
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 12 years ago 42259
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... 12 years ago 35771
How to update many-to-many relationship
nihaoit 12 years ago 15204
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 12 years ago 9266
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 12 years ago 12956
4.1
If you’re using blade, you can use the following to easily output style and script tags.
hengkiardo 12 years ago 8447
Generating A Drop-Down List
vjmani22 12 years ago 9479
4.0