I want to get a value from the ajax call in controller function. How can i do it?
My code is here:
<a href="javascript:void(0)" onclick="amount_pay('');"><i class="fa fa-pencil-square-o"></i></a>
My script:
<script>
function amount_pay(id)
{
$.ajax({
type: 'POST',
url: 'amount_popup/'+ id,// calling the file with id
success: function (data) {
alert(1);
}
});
}
</script>
My route:
Route::post('amount_popup/{id}', 'AdminController\AmountController@amount_to_pay');
my controller function:
public function amount_to_pay($id)
{
echo $id;
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TDeu7r
via IFTTT
Aucun commentaire:
Enregistrer un commentaire