Laravel Community Tools by Tighten

Tag "patterns" tricks

39 tricks
Separate routes for large applications into multiple smaller route partial files that are automatically loaded at runtime. Example 'app/routes.php' file.
jhauraw 11 years ago 14994
lighttpd server configuration files
yuchao 11 years ago 10012
I use this to always know in my controllers if the current action is shown through a Facebook tab iframe. Upon the first request this checks if there is a "signed_request" variable posted to the page. Then $fb_state is set to true and shared with all views. The problem is that on navigating to the next page within your app this variable is lost and you don't know if this is shown through facebook. Due to the FB page proxy you can't use sessions to remember this for the next request either. I solve this problem with adding "signed_request" as a parameter (i.e. "&signed_request=123ljshgljsdhflsdhfl") to every link and form when $fb_state == true. Of course you could also pass any other variable if you don't need the actual signed_request data.
flei 11 years ago 8350
Hi guys , I wanna share with you this trick that you may don't know or did not used it before . what if you want to do something like this . Animals::dogs(); or Animals::cats(); how you can achieve this ... well it's simple with eloquent
anouarabds... 11 years ago 9682
Hi guys, well let me share with you this trick that you may not know: isn't going to be great to use collection methods with your own array . well laravel make this simple , we can know turn our arrays to collections and interact with its just as we do with eloquent collection .
anouarabds... 11 years ago 14418
I think this is very nice and simple :D You can modify at will you. I think this will save the use of `use` when you make a controller that has a namespace
gravitano 11 years ago 14725
If you’re using blade, you can use the following to easily output style and script tags.
hengkiardo 11 years ago 8341
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 47010
We have released the source code of this website! You can check out the repository containing a mirror copy of this website: https://github.com/CodepadME/laravel-tricks to create your own websites like Laravel-tricks. It uses PSR-2 coding standards, a ton of libraries and packages and is a good resource to take a look into.
msurguy 12 years ago 9651