Laravel 5 : How to create middleware to check custom headers for REST API with example

While creating a REST API we generally need to check headers data, For REST API, headers play vital role to make more secure to the APIs. In this article i am going to tell you how to create middleware to check custom headers for REST API with an example. For REST API we generally use API token and… Read More »

Laravel validate different types of Date Format with Laravel validator

Laravel provides different types of validators. But in this article i will let you know how to validate different types of Date Format with laravel validator. Laravel provides different type of date validations like date after, date_format, after_or_equal:date, before:date, before_or_equal:date etc and these validation rules support all the date format supported by PHP’s Date class. In this example, we… Read More »

How to block IP addresses from accessing a web application with an example in Laravel

Sometimes we need to stop the false traffic or a scrapper from accessing our web application.  So in this article, i will let you know how to block IP addresses from accessing a web application with an example in Laravel. It will also help for Denial of service (DOS) attack. It is very important topic for a web deveoper… Read More »

Laravel middleware to remove/trim empty white spaces from user input

In this Laravel article i will let you know to create Laravel middleware to remove/trim empty white spaces from user input. Sometimes an user searches for an empty string and get an empty result becauase empty string behave like a character which is corerct but not a good practice for security reason to send user data directly into the… Read More »

Laravel 5 custom middleware for 301 redirection to non index.php url

Since we all know that index.php in the url is not a seo frriendly url. So if we go an application for production we generally optimize web application’s url. So inthis article i will let you know about Laravel 5 custom middleware for 301 redirection to non index.php url. Basically to achieve the url without index.php in laravel we… Read More »

PHP Laravel database seeder example with some sample user data insertion

Before jumping to anything, the first thing that may come to your mind “what is seeder” and “how can we use it in our laravel application”. Here in this article we are going to learn PHP Laravel database seeder example with some sample user data insertion and learn how to use database seeder in laravel. As a developer, while… Read More »

How to disable MYSQL strict mode

Sometimes while working on an application we got an error like “In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column ‘column_name’; this is incompatible with sql_mode=only_full_group_by”. It means this is an issue of mysql strict mode. In the newest version of mysql, it is defaulted on in mysql. So here in this article… Read More »