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

screwtape_mk's avatar

Target class [install] does not exist.

I am upgrading my laravel application. I am finding the following error:

Target class [install] does not exist. Illuminate\Contracts\Container\BindingResolutionException

I bumped into a recommended solve here:

https://stackoverflow.com/questions/78367409/target-class-files-does-not-exist

The suggested solution seems to be around service providers no longer being registered in config/app.php but in bootstrap/providers.php

When I tried to add them manually I get the following error: class_exists(): Argument #1 ($class) must be of type string, array given

Here is the bootstrap/providers.php:

``<?php

return [ App\Providers\AppServiceProvider::class,

   'providers'=> [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Notifications\NotificationServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    Illuminate\Redis\RedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,

    /*
     * Package Service Providers...
     */

    /*
     * Application Service Providers...
     */
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    // App\Providers\BroadcastServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    'Billow\PayfastServiceProvider',

],

];``

0 likes
3 replies
JussiMannisto's avatar

You're adding a nested array in bootstrap/providers.php, which is wrong.

Incorrect:

return [ 
	App\Providers\AppServiceProvider::class,
	'providers' => [
		Illuminate\Auth\AuthServiceProvider::class,
		(...)
	],
];

Correct:

return [ 
	App\Providers\AppServiceProvider::class,
	Illuminate\Auth\AuthServiceProvider::class,
	(...)
];

But you don't need to register the framework's default service providers manually. These are all the Illuminate providers. They're automatically registered by Laravel unless you override the app.providers config. You can delete the app.providers array and copy just the app's custom providers to bootstrap/providers.php. Those are the ones under the "Application Service Providers" comment.

screwtape_mk's avatar

@JussiMannisto before I perhaps proceed with altering any providers default code, would you have any ideas on what might be the cause of the issue, if you can suggest some troubleshooting ideas. My solution there was based purely on the stackoverflow link i provided.

Additional information for the error above (The below is highlighted:

public/index.php :20 $app->handleRequest(Request::capture());

JussiMannisto's avatar

@screwtape_mk I showed you what's wrong: you're defining the providers incorrectly in bootstrap/providers.php. The error message also tells you that: Argument #1 ($class) must be of type string, array given. The first answer on that SO page doesn't say you should create a nested providers array inside bootstrap/providers.php.

You can create a fresh Laravel 12 project to see what the default provider configuration is nowadays. There is no app.providers array.

Please or to participate in this conversation.