I am working on laravel project and i need to make AJAX post to custom function in laravel.
My question is where to put function.php and how to call and pass variables from js function inside view/template.blade file with AJAX?
Atm i have
-
/app/develu/vathelper.php
-
Inside autoload_classmap.php i have path to my function
'App\develu\vathelper' => $baseDir . '/app/develu/vathelper.php',
- Autoload_static.php
'App\develu\vathelper' => $baseDir . '/app/develu/vathelper.php',
- Routes.php
Route::get('/clients.vat', 'vathelper@vatcheck'); Route::post('/clients.vat', 'vathelper@vatcheck');
5.
$.get('/clients.vat', function(){
$('.p-test').log('response');
});
My end goal is to make form and send data with post to a function inside helper and get response to js, and echo it inside table, the only thing i can't figure out is how to post and get inside laravel.
via Nikas Nikis