Tag : Middleware



Laravel 5.5 Create Custom Middleware example

Middleware are used for filter HTTP requests in your web application. One of the basic requirement of any web application is HTTP requests filter, so we have to make is well for example make auth middleware. auth middleware always check if you are going then and then you can access those page. In laravel 5.5 application they are provide several default web middleware but in this tutorial we are going to create custom middleware for laravel 5.5 application. In this example, i am going to create "checkType" middleware and i will use simply on route, when they route will run you must have to pas.....

By Hardik Savani | September 17, 2017 | | 1406 Viewer | Category : PHP Laravel
READ MORE

How to create ban/revoke user functionality in Laravel 5 example ?

In this tutorial, i am going to share with you how to create user block and unblock feature in your laravel 5 application using laravel-ban composer package. It will mostly require to create user ban and revoke functionality for security reason. If you are developing big web application then it must be require to enable and disabled user when admin user want. Because some user make in-activity on our website then we could ban that user. So basicaly it is good if you are give user ban and revoke functionality to client on your laravel 5 application. In this article, we will learn how to make .....

By Hardik Savani | June 14, 2017 | | 6530 Viewer | Category : PHP Laravel Bootstrap jQuery MySql
READ MORE

Laravel 5 - Simple user access control using Middleware

We always require to built user access control in our application, when we start. I posted <a href="http://itsolutionstuff.com/post/laravel-52-user-acl-roles-and-permissions-with-middleware-using-entrust-from-scratch-tutorialexample.html" target="_blank">User ACL Roles and Permissions using entrust</a> for laravel 5 application. But as you can see on my post it is very useful and fantastic, But if you have big application or like e-commerce application. Because User ACL is take a time to implement. Yes, if you have small or medium level application and you don't require to make permission with.....

By Hardik Savani | February 26, 2017 | | 48228 Viewer | Category : PHP Laravel
READ MORE

Laravel 5 - How to prevent browser back button after user logout?

Today, I am going to share with you How to prevent back button after logout in PHP Laravel framework. If you observe deeply then you found this fault, When user logout after if user hitting back button from browser then it will goes on home page or existing page that he was before login. But it should redirect on Login page instead of homepage or other existing page. But we can prevent this issue by using Laravel middleware. We will create one middleware and prevent back button history. So we have to create new middleware and use that middleware in our route. So, I am going to do from scratc.....

By Hardik Savani | October 21, 2016 | | 25389 Viewer | Category : Laravel
READ MORE

How to create middleware with parameters in Laravel 5?

Laravel is the best framework in PHP todays. Laravel framework provide saveral functionality and you can also find from this site. But now in this post you can learn how to create custom middleware with passing parameters in laravel 5 example and how to use middleware with route parameters in laravel 5. In this example you can learn how to add middlware with check user have access role for this route from scratch in your laravel application. I also added how to create middleware in my previous post, you can see that also. In this example i added middleware for check use have role access for .....

By Hardik Savani | June 8, 2016 | | 3559 Viewer | Category : Laravel
READ MORE

Laravel 5 - How to get route parameters in your route middleware?

Sometimes we may require to get route parameters value in our middleware like if you want to check permission etc. You can get easily using request object, that provide route method and you can get it. I also added small example that way you can undestand very well. In this bellow route i have id and userid two route and i want to get value of that parameters in my "check-route-param" middleware so first i have route like: <strong>Example Route:</strong> <pre class="prettyprint lang-php"> Route::group(['middleware' => ['web','check-route-param']], function () { Route::get('{id}/myroute/{.....

By Hardik Savani | May 14, 2016 | | 3825 Viewer | Category : Laravel
READ MORE

How to create and use Middleware in Laravel 5?

Laravel is the best framework in PHP todays. Laravel framework provide saveral functionality and you can also find from this site. But now in this post you can learn how to create custom middleware as filter in laravel 5 example and how to use middleware in laravel 5. In this example you can learn how to add middlware from scratch in your laravel application. In this example i added middleware for check if user is admin then it can open someroute like ACL. So i added <strong class="path">id_admin</strong> column in my users table if use have is_admin = 1 then it can access "admins" route. So .....

By Hardik Savani | April 24, 2016 | | 27339 Viewer | Category : Laravel
READ MORE

Laravel 5.2 API using JWT authentication tutorial from scratch example

In this post i want to share you how to create API in Laravel 5.2 with using JWT, If you are beginner then It is a very simple way to create and it is pretty easy to undestand how to create API. After this you can make more secure and complex your API. you can learn JWT authentication from back-end side. we have to learn how to works API from front-end and back-end side. i give you both side fully example how it works and use. <img width="100%" src="/upload/laravel-jwt.png" style="border:2px solid cadetblue"> JWT stand for Json Web Token. JWT will helps to create authentication and connect fro.....

By Hardik Savani | March 31, 2016 | | 163741 Viewer | Category : Laravel jQuery AngularJS Ajax JWT
READ MORE

How to create middleware for XSS protection in laravel 5?

XSS(Cross Site Scripting) protection must need in your site because if you do not XSS protection then your site is not secure. XSS filter through you can remove html tag from your input value and it is very important to remove html tag for security. in your laravel 5.2 application you can implement by using middleware concept in your project. so how to create XSS filter middleware in your laravel application by using following step. First fire following command and create middleware: <strong class="step">Create Middleware</strong> <pre>php artisan make:middleware XSS</pre> Now, you can see new.....

By Hardik Savani | March 4, 2016 | | 7327 Viewer | Category : PHP Laravel
READ MORE

    AngularJS - scroll to a specific element using anchorscroll

    AngularJS - scroll to a specific element using anchorscroll

    Open Post

    AngularJS - How to create read more/less toggle using Directive?

    AngularJS - How to create read more/less toggle using Directive?

    Open Post

    PHP - jquery datatables with mysql database example from scratch

    PHP - jquery datatables with mysql database example from scratch

    Open Post

    PHP - jquery ajax crop image before upload using croppie plugin

    PHP - jquery ajax crop image before upload using croppie plugin

    Open Post

    Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.

    Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.

    Open Post

    How to add charts in Laravel 5 using Chart JS ?

    How to add charts in Laravel 5 using Chart JS ?

    Open Post