Tag : Middleware


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 | | 22738 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 | | 10253 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 | | 1597 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 | | 1530 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 | | 7038 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 | | 54826 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 | | 3557 Viewer | Category : PHP Laravel
READ MORE

    Laravel 5 and Vue JS CRUD with Pagination example and demo from scratch

    Laravel 5 and Vue JS CRUD with Pagination example and demo from scratch

    Open Post

    How to add multiple markers in google map

    How to add multiple markers in google map

    Open Post

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Laravel 5 generate sitemap using roumen/sitemap package Example

    Open Post

    Laravel 5 - Authenticate user in NodeJS with socket io using JWT.

    Laravel 5 - Authenticate user in NodeJS with socket io using JWT.

    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 CKEditor with image upload using KCFinder in PHP Example Code?

    How to add CKEditor with image upload using KCFinder in PHP Example Code?

    Open Post