Category: Laravel

Set XSRF(/CSRF) Token Globally or TokenMismatchException in Laravel 5.* (for AJAX)

LaravelLaravel 5CSRF Tokenskpaulskpaul82TokenMismatchException

Very easy (পানির লাহান) 🙂 STEP – 1: First we have to ad a meta tag (name=”_token”) in header <meta name=”_token” content=”{{ csrf_token() }}” /> STEP – 2: Then add below jQuery snippet before the </body> tag. Basically here we setting up the csrf token globally for ajax request. And after this we don’t need to ….  Read More

How to define Global Variable or Constant in Laravel

DevelopmentLaravelLaravel 5PHPGlobal ConstantGlobal VariableLaravel 5.2phpskpaulskpaul82

We often need to define global variables/constants for our application, like Status, Conditions, Countries (we can put all countries in table as it will be along array/object), also weekdays, weekends and e.t.c. vary on projects. Status (Active, Inactive) and Conditions (Ok, Good, Better, Best) or Grade (F, C, D, A, A-, A+), so like these ….  Read More

Laravel 5 tricks (rough for me)

LaravelPHP

I need these few thing when I am working on Laravel 5. You can add more by comment..   How to install packages by composer ————————————————– adding a package: composer require vendor_name/package_name removing a package: composer remove vendor_name/package_name adding form and html package: —————————– composer require illuminate/html for pdf package (reporting: generating pdf): ——————————————- composer ….  Read More