I have this ugly bit of code but can't seem to find the right syntax to simplify it
$request->response is a string corresponding to one of three buttons on a form. The buttons have values of 'approve', 'query' and 'refuse'
in the snippet I am trying to call a function that has the name specified in the request. So, if the user presses 'approve' then
$this->approve() is called
$this->$request->response($task); but the syntax is not right.
it works as I have it now but it's annoying me everytime I see that $r variable
and, yes, my form request validates that response can only be one of the three method names.
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.