Laravel Community Tools by Tighten

Popular tricks

458 tricks
Its Diffucult to convert whole object to an array . Normally we are Doing it By Iterate through foreach. By using Below Code we will reduce amount of line of code
kmlnyk 10 years ago 11528
When saving/updating a model you might want to get a JSON response that includes some relationship data as well.
m4nuC 12 years ago 11490
Remove tags in controller with excepts fields https://gist.github.com/oLDu67/10863c9f51064d1d9390016b28143f85
racibaz 9 years ago 11477
Uses "thepixeldeveloper/sitemap": "dev-master" in composer.json to create a better organised sitemap structure via multiple "files" (routes).
nik-418 12 years ago 11301
A few days ago I released a new package called obiefyapi-response, It is simple api response wrapper for laravel, you can give it try from GitHub URL: https://github.com/obiefy/api-response
obiefy 7 years ago 11295
api
If you are running Laravel 4 behind Cloudflare over HTTPS some functions like ‘Request::secure()’ and ‘Request::isSecure()’ will return false. By using the setTrustedProxies method of the Request facade we can add the Cloudflare IP ranges to trust, thus the Request class will honor the ‘X-Forwarded-Proto’ and other ‘X-Forwarded’ headers.
zOxta 12 years ago 11204
Sometimes, you have differences between your dev set-up and production set-up that requires you to be able to set a different value for public_path. In your bindings.php file, just add the following code and you will be good.
ve2gmr 12 years ago 11117
example of how to test API with Codeception and Laravel
Mahmoudz 11 years ago 11001
5.0
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 10960
4.1