Laravel Community Tools by Tighten

Popular tricks

458 tricks
Custom image dimensions validator for minimum height and width.
aglipanci 11 years ago 13044
5.0
There are a few tips already for active states on navigation, however none are based on Route names. I prefer to use Route names for all routes, so here is a modified version of the "active states" trick for route names.
chadwithuh... 12 years ago 12936
Save yourself from all the boilerplate of tracking/observing and reacting to model attribute changes.
alexstewar... 4 years ago 12945
This snippet will explain how to use environment variables to configure your environment. Blog post: http://dor.ky/laravel-homestead-add-enviroment-variables-to-nginx/
ssx 11 years ago 12914
4.1
Dynamically testing and Pagination feature in a Restful API
Mahmoudz 9 years ago 12881
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 12848
4.1
Here a user has a location with many to many positions. This query finds users having position id 4 and location id 6. the tables are users, profile, locations. and profile has location_id.
sanjok1988 5 years ago 12814
If I Let You Go, I Will Never Know - Westlife
saiming96 5 years ago 12775
Laravel offers a dynamic interface for assigning certain data. This can be used e.g. for adding a dynamic 'where' to your Eloquent queries. However, not everyone know that this same trick also works on View assignments!
stidges 12 years ago 12712