脚本php artisan优化处理post-update-cmd事件,返回错误代码1和laravel 5.4

Hi I work on a macbook and use Xampp and I have a problem on my laravel project 5.4. When I do composer update I had this error:

In Connection.php line 647: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from houses)

In Connector.php line 68: SQLSTATE[HY000] [2002] Connection refused

Script php artisan optimize handling the post-update-cmd event returned with error code 1.

I don't know how to resolve that I check the user of my database it's root, I check my .env in my laravel project the name, user and password are ok, I can access to phpmyadmin, I imported the database file on phpmyadmin. And when I do php artisan serve

I have this error:

In Connection.php line 647: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from houses)

In Connector.php line 68: SQLSTATE[HY000] [2002] Connection refused

But I think it's normal because the composer update didn't worked.

First clear cache if any changes was made in .env:

php artisan config:cache