Laravel Community Tools by Tighten

Popular tricks

458 tricks
With database seeding you can fill your database with dummy data with simple command. I created code that will fill users table with some data. users table consists of three columns (username,email,biog).
Clivern 12 years ago 58050
When you need to pass some data to the Mail::send or Mail::queue, you need to make use of the "use" approach:
aglipanci 11 years ago 56041
Handling findOrFail exceptions
bwsewell 12 years ago 53960
If you're like me, you don't like to keep repetitive ->where()'s in your routes file, this is where route patterns come in handy. Makes your routes file DRY too, especially when you'll need to change some expression.
vlakarados 12 years ago 51166
In the background create your paginated response however you wish.
clouddueli... 12 years ago 48344
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 47000
When user clicks on "delete" button, open a confirmation box before deleting an item.
ismaeltoe 10 years ago 46622
Since Eloquent doesn't do a real join when using "with" this will add a simple join method without having to worry about the join columns since it's all stored with the models anyway. It will also select all the columns from the joined table with an added prefix of the table name.
phazei 11 years ago 45235
Use laravel pagination with this small bit of jquery to ajax load paginated results. Create a page with the data you wish to paginate. http://www.example.com/paginated/data
riddles888... 12 years ago 44722