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

Rav23's avatar
Level 11

Laravel 5.3 not working with Valet

A clean install of Laravel 5.3 is not working with Valet. I'm getting the following error:

Parse error: parse error, expecting '&'' or"variable (T_VARIABLE)"' in /Users/Oz/Apps/gestlab/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475

But if I install a fresh copy of Laravel 5.3 on homestead and add the corresponding configuration on the hosts file everything works fine.

Why am I not able to use Laravel 5.3 with Valet?

0 likes
6 replies
Snapey's avatar

Are you running a different php version in homestead compared to your local install (valet)

Rav23's avatar
Level 11

Yeah. PHP Versions:

Homestead: PHP 7.0.8 Local: PHP 7.0.6

Laravel 5.2 works fine with Valet though. I'm only having issues with version 5.3

Snapey's avatar

Line 475 is the start of the event() helper, yes?

Have you tried php artisan clear-compiled ? (clutching at straws here)

Rav23's avatar
Level 11

Yeah, it's the start of the event helper. I've tried that without any success. What I find weird though is that an install of laravel 5.2 works fine. Therefore, it leads me to believe that perhaps Valet needs tweaking in order to work with Laravel 5.3...

Snapey's avatar

I only replied because I am happily running Valet with laravel 5.3.0 and 5.3.8 with php 7.0.7

Rav23's avatar
Level 11

Just managed to solve it by reinstalling Laravel Valet. I had upgraded my version of PHP prior to testing out Laravel 5.3. I believe that the reason it worked for 5.2 based projects was because Valet stores the path to the PHP version currently in use.

Since I was using a different PHP version for Laravel 5.2 it didn't update the changes to 5.3. Therefore, by reinstalling Valet, it also pointed to the updated PHP version.

All is working now.

1 like

Please or to participate in this conversation.