Level 102
Which version of php are you running?
1 like
I have an issue to make an async HTTP request with larevel 8.11.2 and php 7.4.11
public function index()
{
$result = response()->json(Product::orderByDesc('updated_at')->get(), 200);
return Http::async()->get()->then(
fn (Response|TransferException $result) => $this->handleResult($result)
));
}
When I save the file it displays this error :
syntax error, unexpected '|', expecting variable (T_VARIABLE)
By they way, I don't know if it's the right way to add the result in the response.
@tako Then you cant use this Response|TransferException $result. It wasnt introduced until 8.0
Please or to participate in this conversation.