php - laravel ajax request error -
jquery:
$.get("{{url::asset('index.php/items/sessionstore')}}" + '/' + itemids, function (data) { alert(data); } );
routes.php
route::get('items/sessionstore', 'itemscontroller@sessionstore');
controller
public function sessionstore($id) { if(request::ajax()) { echo $id; echo "ajax"; } else { echo "no ajax"; } }
my error is:
{ "error": { "type": "symfony\\component\\httpkernel\\exception\\notfoundhttpexception", "message": "", "file": "d:\\wamp\\
change route
route::get('items/sessionstore/{$id}', 'itemscontroller@sessionstore');
Comments
Post a Comment