Simple question, I think.
I have a route that calls a function in a controller. In that controller, I have a call to another controller function.
For example:
$_testing = with(new TestingController)->prepwork($variable1,$variable2);
Inside of TestingController prepwork(), if a condition matches, I
return Response::view(...);
Question - how come that isn't enough? the return just returns control back to the calling function (which makes sense), but how do I tell Laravel - stop what you are doing and output that view.
To make it work, I have to:
$_testing = with(new TestingController)->prepwork($variable1,$variable2);
return $_testing;
That doesn't really work as the prepwork is designed to do some heavy lifting and then output a result model. The view is only kicked off when there is an error.
And YES - I know I can do something like this:
if ($_testing->whatImCheckingForErrors) { return Response::view(...); }
I'm just trying to understand why the return Response::view doesn't end the processing... If that makes sense.