I want to call laravel helper function in javascript. I don't know whether it is possible or not but i have tried by this way but failed
function checkout(){
var cartArray = shoppingCart.listCart();
var output = "";
for(var i in cartArray) {
output += "<tr class='rem3'>"
+ "<td class='invert'> " + resturant(cartArray[i].resturant) + " </td>"
+ "</tr>";
$('#checkouttable').html(output);
}
Laravel helper function
if(!function_exists('resturant'))
{
function resturant($id)
{
$resturant = Resturant::find($id)->restaurant_name;
return $resturant;
}
}
Error Uncaught ReferenceError: resturant is not defined