Tag : Middleware


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 | | 3133 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 | | 1147 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 | | 1196 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 | | 1706 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 | | 15414 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 | | 2748 Viewer | Category : PHP Laravel
READ MORE

    AngularJS - simple image upload with preview example in PHP

    AngularJS - simple image upload with preview example in PHP

    Open Post

    How to get Instagram followers count using JQuery Ajax?

    How to get Instagram followers count using JQuery Ajax?

    Open Post

    Laravel 5 - GEO chart example and demo using lavacharts package

    Laravel 5 - GEO chart example and demo using lavacharts package

    Open Post

    Jquery Select2 - Select box with search example code

    Jquery Select2 - Select box with search example code

    Open Post

    Laravel 5 - Barcode generator example using milon/barcode package

    Laravel 5 - Barcode generator example using milon/barcode package

    Open Post

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Laravel 5 - Multiple Images Uploading using dropzone.js example with demo

    Open Post