Terminate method in middleware in laravel

I wanted to define a case if a function return false in a terminate() method in laravel middleware so this is what I did

    $parsedData = $this->parse($request);
if(!$parsedData){
dd("hello");
}

the condition is running fine but when I am calling response it is not showing anything

$parsedData = $this->parse($request);
if(!$parsedData){
return Response::json(array(
'success' => false,
'info' => "error"
), 422);
}
\\ called the Response helper

am I doing anything wrong in this case?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3AgwZFF
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

BlueHost Web Hosting Review: Secrets Revealed for Shared Hosting

How to Create Treeview with Bootstrap and jQuery

Submit Form using jQuery AJAX and PHP without Page Refresh