twitter github codepen dribbble rss

Handling Laravel CSRF Token Mistmatch Exception

To protects your website from cross-site request forgery (CSRF) attacks, Laravel automatically generates CSRF token for each active user session. That token will then be verified by VerifyCsrfToken middleware whenever user submits the form. It will throw TokenMismatchException error if CSRF token is expired or doesn’t match. That’s why sometimes you see this error when you submit form…

Create Laravel Facades Quickly with Realtime Facades

Aside from using global functions, you can use Laravel Facades to create your own helper functions. Normally, you need to create three classes when making custom Laravel Facade. First one is the main class which is the place to put all of your custom functions. The other two are a Service Provider class and a class that extend Illuminate\Support\Facades\Facade….

Split Laravel Routes into Multiple Files

If you look at Laravel 5.3, the routes are not defined in one file anymore like in the previous versions instead they are defined in three files under the routes folder. Two files are for URL routes (api.php and web.php), and the other one is for artisan commands (console.php). So, what’s that means? Well, we can…

How to Make Helper Functions in Laravel 5

When developing a website with Laravel, sometime we need to create a custom helper function that can be called anywhere in our code. For example, we can make a function that returns our site title. function site_title() { return ‘Something’; } And calling it in our blade template. <head> <title>{{ site_title() }}</title> </head> In order to be…