The error message "Method Illuminate\Foundation\Application::share does not exist" suggests that the version of Laravel being used is not compatible with the version of Laravel Excel being installed. Laravel Excel v1.1.5 is only compatible with Laravel 5.1 to 5.5. If you are using Laravel 6 or higher, you should use Laravel Excel v3 or higher.
To fix the issue, you can try installing a compatible version of Laravel Excel. For example, if you are using Laravel 6, you can install Laravel Excel v3 by running the following command:
composer require maatwebsite/excel:^3.1
Then, add the service provider to your config/app.php file:
'providers' => [
// ...
Maatwebsite\Excel\ExcelServiceProvider::class,
],
If you are still having issues, you can try clearing the cache by running the following command:
php artisan cache:clear
You can also try running the following command to publish the config file:
php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider" --tag=config
This will create a config/excel.php file that you can customize to fit your needs.
If none of these solutions work, you can try posting a question on the Laracasts forum or opening an issue on the Laravel Excel GitHub repository.