Laravel Community Tools by Tighten

Category "Routing" tricks

91 tricks
Laravel de URL desenlerini yazılımcının sabit bir yaklaşımından uzaklaştırarak SEO için renklendirmeye yarayan bazı kullanımları.. http://elmacademy.net/
doguhan 11 years ago 8472
İşin Türkçesi şu: Controller dan Master içine değer aktarılarak tüm view ler için özelleştirilebilir head meta tag yada diğer değişmesini istediğimiz dinamik alanların oluşturulması..
doguhan 11 years ago 7693
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 14973
lighttpd server configuration files
yuchao 11 years ago 9997
If you want to redirect all HTTP traffic to HTTPS (SSL) you can use this method. However, note that this may NOT work out of the box if you are behind CloudFlare/load balancer/reverse proxy unless you set a trusted proxy, more info here: http://www.laravel-tricks.com/tricks/fix-ssl-in-laravel-4-when-server-is-behind-a-load-balancer-or-a-reverse-proxy
zOxta 11 years ago 32838
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 8341
When showing a website through a Facebook Page tab validation errors are not displayed, because Facebook "forgets" the sessions due to the page proxy. One problem with this is that session data is destroyed / forgotten on each request going through that proxy. This applies to Redirect::back()->withErrors($validator) for showing the form with validation errors because sessions are used . To avoid this simply fiddle the error data together and pass it directly to the respective action that handles the input form. One thing to mention is that calling other controller actions directly of course does not affect the route. Let's say editing happens at "/edit" and the "registration complete" message is shown at "/complete". Calling the action within the controller the form with errors is now shown at "/complete" whereas "/edit" would be shown if you redirected back (Line 22). I personally don't really care too much about this since the "real" web address is not shown in the FB page tab anyway due to the page proxy. Looking forward to hearing your opinions on this. Maybe there is even a better way.
flei 11 years ago 13838
By this line adding to the app/routes.php file, you can apply 'csrf' filter to all routes
milon 11 years ago 8521
In case you want to access Route parameters outside controller, you can access current Route object and extract parameters from there.
YOzaz 11 years ago 21812
4.1