Laravel Community Tools by Tighten

Recent tricks

459 tricks
Automatic adding user id. In the: First create columns into database tables with names "updated_by" and "created_by"
fhferreira 12 years ago 18147
Will validate a route pattern against the current route.
eugene_san... 12 years ago 9950
It truncates all tables and then it runs all seeders available.
kostaspt 12 years ago 17456
Gulp is a javascript taskrunner (like Grunt) using Nodejs. You can use it to automatically run PHPUnit tests on saved files. Ex: Save Foo.php and run FooTest.php automatically. Link to gist: https://gist.github.com/varghesejacob/56e2637dcb5cd2bc4b51
residualfl... 12 years ago 12740
If you have an array like: array( array('key' => 'value'), array('key' => 'anotherValue'), array('key' => 'sameValue'), array('key' => 'sameValue') ); and you want to make sure that you cant have 'key' with same value twice i was searching a native way to do it, but couldn't find one - so this is my solution:
dani3l 12 years ago 10825
4.1
Perform pattern based CSRF filter on all post, put, patch, and delete requests. Just add this code snippet at the top of routes.php
Illusion 12 years ago 6745
When saving/updating a model you might want to get a JSON response that includes some relationship data as well.
m4nuC 12 years ago 11351
Response::xml macro
localdisk 12 years ago 32910
This stumped me for some time and after digging around I found it works great, the uploaded file can be removed from the server as well as the database entry. works well for file sharing and image sharing sites.
blackrain 12 years ago 22716