Composer update encountered “Script php artisan optimize handling the post-update-cmd event returne when upgrading laravel

“Script PHP Artisan handling the post-update-CMD event returned with error code 255”
Try:
First: Delete the PHP file under bootstrap/ Cache
And then:

composer dumpautoload
composer update

Read More: