B
B
Barney_Gubmle2019-01-29 13:31:47
Laravel
Barney_Gubmle, 2019-01-29 13:31:47

Why is laravel not returning view?

Good afternoon.
There is a form that sends us to the controller, in the controller the function is divided into two parts
a) if the button "a"
is pressed b) if the button "b" is pressed

public function fun(Request $request)
{
if($request->input('a') { 
............
...........
$array = [1,2,3]
return view('view', [ 'arr' => $array]);
}
elseif($request->input('b') {
.......
}
}

everything works, but as soon as I move function A into a separate one, I would change the code to:
if($request->input('a') { 
  $this->a();
}

the array comes in correctly, but the view is not returned. those. I get just an empty window, without any errors and so on. Who can know what is the reason? I suspect that in the request. but in this function the request is not used.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2019-01-29
@Barney_Gubmle

if($request->input('a') { 
  return $this->a();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question