Class 'Maatwebsite\Excel\Excel' not found
You are encountering a classic version mismatch between your Laravel application and the Maatwebsite Excel package. The error Class 'Maatwebsite\Excel\Excel' not found appears because you are attempting to use Laravel 5.5 with Maatwebsite/Excel version 3.0. While this combination works on your local environment, it fails immediately upon deployment to a server where the composer autoloader cannot resolve the necessary dependencies.
The root cause lies in the dependency constraints defined in composer.json. According to the Composer error output you provided:
maatwebsite/excel 3.0.0 requires illuminate/support ^5.6
...
illuminate/support v5.6.x conflicts with laravel/framework[v5.5.40]
Laravel Framework 5.5 is built on illuminate/support version 5.5.x, but Excel 3.0 explicitly requires illuminate/support version 5.6 or higher. Composer refuses to install Excel 3.0 alongside Laravel 5.5 because the underlying core libraries are incompatible. This is why the installation succeeds locally if your local composer.lock file is missing or outdated (allowing a temporary mismatch), but fails on the server where the dependency graph is strictly enforced.
Solution: Downgrade the Excel Package
To resolve this without upgrading your entire Laravel application to version 5.6 or 5.7, you must install a version of the Excel package that supports Laravel 5.5. The last major release compatible with Laravel 5.5 is Excel 2.x.
Run the following command in your project directory:
composer require maatwebsite/excel:^2.0
This will pull a version like 2.1.3 (or similar within the 2.x range) which adheres to the dependency constraints of Laravel 5.5. Once the command completes successfully, run composer dump-autoload to ensure the class loader is rebuilt with the correct paths.
Alternative: Upgrade Laravel
If you are committed to using Excel 3.0 and its modern features (such as improved memory management for large files), you must upgrade your entire application stack. You cannot mix a Laravel 5.5 core with an Excel package designed for 5.6+.
Run this command to update the framework:
composer update laravel/framework
Important Note: Upgrading from Laravel 5.5 to 5.6 is not just a matter of running composer update. It involves significant architectural changes, particularly regarding configuration files and service providers. You will need to review your config directory and potentially migrate database migrations if any schema changes occurred between versions. This path introduces high risk for existing applications.
Configuration Verification
After installing the compatible Excel version (2.x), ensure that the service provider is registered in config/app.php. For Laravel 5.5, you must manually register the package:
'providers' => [
// ... other providers
Maatwebsite\Excel\ExcelServiceProvider::class,
],
'aliases' => [
'Excel' => Maatwebsite\Excel\Facades\Facade::class,
],
In newer Laravel versions (5.6+), this is often handled automatically via the Service Provider auto-discovery mechanism introduced in the framework, but Laravel 5.5 requires explicit registration to resolve the Maatwebsite\Excel\Excel class correctly.
Conclusion
The error is strictly a version conflict resolved by aligning the Excel package version with your specific Laravel minor version. Sticking to Excel 2.x for Laravel 5.5 is the most stable and immediate fix, whereas upgrading requires careful planning regarding database migrations and configuration changes.