Laravel Community Tools by Tighten

Category "Requests and Input" tricks

68 tricks
This piece of middleware can be applied at a global level, or on a per-route basis. The idea is that instead of polluting your databases with HTML and other potentially damaging data as a result of user input, this middleware will immediately strip all tags from any input, before it gets to validation or saved to a database. The result? A more dependable solution that doesn't require developer memory to implement safe output rules + cleaner data in your database.
kirkbushel... 10 years ago 16344
5.0
Custom image dimensions validator for minimum height and width.
aglipanci 11 years ago 12980
5.0
Let's talk about date validation and how theses 4 rules works, as their behaviour is even more awesome than documented. What is know : - date, before and after uses strtotime PHP native function. - date_format uses date_parse_from_format PHP native function But how do we validate a date after today in a custom format ? And what to do to compare two form fields ? What is not documented is that before and after rules check if a date_format rule exists, and will use this format if needed. Example: I have french formated dates (31/01/2015), and two fields, start_date and end_date. start_date must be after tomorrow, and end_date after start_date
Lelectrolu... 11 years ago 58073
5.0
When validating data belonging to multiple models you might be missing errors if you run your validators one by one. This simple trick combines validators and their errors.
The Saint... 11 years ago 16570
4.2
Simply add the following lines to ./app/start/global.php at the "Application Error Handler" - Section there is no need to touch the "CSRF Protection Filter" at all.
etenzy 11 years ago 20924
reponse:json() to remove "" from numeric values
extjac 11 years ago 9155
Route tanımlanan URI için, Closure aktarılacak değerlerin sınıflandırılması konusundaki desenler...
doguhan 11 years ago 7914
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 8442
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 32792