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

wipflash's avatar

Laravel 10 upgrade error in AuthServiceProvider.php

I am trying to upgrade my Laravel application from 9 to 10, but I encounter this error. This is coming when the composer install.

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In AuthServiceProvider.php line 36:
                                                               
  foreach() argument must be of type array|object, null given  
                                                              
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

So this is came from AuthorizeServiceProvider same as AuthServiceProvider;

public function boot()
    {
        $this->policies = $this->getEntityPolicyBindings();
        $this->policies[SubscriptionData::class] = SubscriptionIndexPolicy::class;
        $this->policies[SubscriptionAddOnData::class] = SubscriptionIndexPolicy::class;
		//$this->registerPolicies();
    }

How we fix this?

0 likes
0 replies

Please or to participate in this conversation.