Laravel Community Tools by Tighten

Tag "4.1" tricks

72 tricks
Hello what if your application when it is logout then you intentionally hit the back button on your web browser, what happened? your application will be returned to the original page, which should be redirected to the login page. Here I share a simple trick, put on a filters.php
cyberid41 11 years ago 24137
how to get query
krucamper 11 years ago 7080
You can use this when you want to add a placeholder to your Form::selectRange or Form::selectMonth.
soffan 11 years ago 11409
If you are running Laravel 4 and behind a load balancer or a reverse proxy, some HTTPS functions like ‘Request::secure()’ and ‘Request::isSecure()’ will return false. If we add the current IP which belongs to the proxy/load balancer to the setTrustedProxies then the Request class will honour the ‘X-Forwarded-Proto’ and other ‘X-Forwarded’ headers and the mentioned functions would work fine. Note: THIS METHOD CANNOT BE TRUSTED unless ALL requests go through a proxy YOU control.
zOxta 11 years ago 25091
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 11 years ago 10744
In many case you want to display values in blade you can do some check sum like this:
star18bit 11 years ago 16407
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 14718
Laravel has many choices for performing a query, sometimes it could be confusing, I hope this list help you to clear any doubts. If you know other way please show it in comments for add it.
luismec90 11 years ago 13936
Starting from 4.1.28, Application::boot() does not initialize sensitive session data anymore. That is, it is accessible, but encrypted. So if you're integrating 3rd party library, which needs external authentification check through sessions, simple checking Auth::check() will not work. However, we can still use old $_SESSION variable. Examples of 3rd party libraries: CkFinder, elFinder (has Laravel package though), MoxieManager. N.B. If you can use Ajax calls for authorization checks, you can still make a custom API with JSON request to user-logged (as an example) to see if user is authentificated.
YOzaz 11 years ago 11659