Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bboyskiemo17's avatar

unexpected '=>' (T_DOUBLE_ARROW), expectin /vendor/laravel/framework/src/Illuminate/Routing/Router.php on line 698

I working in Laravel project for the first time and when I upload my Laravel project in cPanel webhosting this is the problem.

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')' in /home/villioso/henanntransport.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php on line 698

this is the part of error code.

protected function runRoute(Request $request, Route $route) { $request->setRouteResolver(fn () => $route);

    $this->events->dispatch(new RouteMatched($route, $request));

    return $this->prepareResponse($request,
        $this->runRouteWithinStack($route, $request)
    );
}

but my project is working in my Local PC I don't know what's the problem. TIA for help.

0 likes
3 replies
lat4732's avatar
lat4732
Best Answer
Level 12

Which Laravel version are you running? Laravel 8 supports PHP 7.3 - 8.1 but Laravel 9 has requirement of minimum PHP version 8.0.

1 like

Please or to participate in this conversation.