Custom class to sanitize input in laravel 5.x [Laravel Security]
11 January 2016By Bhavyanshu Parasher
First, we will create a folder /app/Common. In this directory, we will place a Utility.php file which is our custom class containing the required methods to clean user input. This utility sanitizes all input provided by the user.
Now we can use it in any of our controller actions where we are submitting a form and saving some data to our database. For example,
Credits: This utility is based on work of usman.it. I just made it compatible with 5.2.