how to join two table in codeigniter easily[updated] | ci_model | ci_controller | codeigniter 3 -datainflow
Avoid token mismatch
Avoid token mismatch in post method using ajax in laravel. Laravel is a most famous framework of php.In laravel when we use form ,there is a hidden field of token.If we submit the form then laravel internally check this token.If we use ajax than this token mismatch error is occured.
To avoid this kind of error ,we have to bypass the route.To do this go to App\Http\Middleware\VerifyCsrf.php file.
class VerifyCsrf extends \Illuminate\Foundation\Http\Middleware\VerifyCsrfToken { /** * Routes we want to exclude. * * @var array */ protected $routes = [ 'api/some/route', 'another/route/here', 'yup/more/routes', ]; }
Add your route in $routes array.That all.
Related posts