Not completely an issue of this package, but the combination of Laravel Telescope in local-only mode (see: https://laravel.com/docs/9.x/telescope#local-only-installation) and the default config of this package could result an error when generating the docs:
In TelescopeServiceProvider.php line 10:
[Error]
Class "Laravel\Telescope\TelescopeApplicationServiceProvider" not found
Steps To Reproduce:
Install Laravel.
Install Laravel Telescope in local only mode.
Install this package ❤️ .
Run composer install --no-dev to exclude development packages.
Set app to any other environment than local in your .env.
Run the command: l5-swagger:generate and see error.
Cause
When running Laravel Telescope in local only mode, the package won't be installed on any other environment than local. The TelescopeServiceProvider won't be loaded, but still extends a non-existing class (from the Laravel Telescope package). The error occurs because the default config of this package scans the whole app folder, so also this service provider.
Possible solution
A few possible solutions might be:
Exclude service providers:
/*
* Absolute path to directories that should be exclude from scanning
*/
'excludes' => [
base_path('app/Providers'),
],
Default to the paths:
/*
* Absolute paths to directory containing the swagger annotations are stored.
*/
'annotations' => [
base_path('app/Http'),
base_path('app/Models'),
],
Let users configure this themselves in their custom config (which I did to solve this issue). Might be worth mentioning in the docs.
I am uncertain if this package should do anything about this, but at least this issue might help some (and probably my future self) with solving that error.
Description:
Not completely an issue of this package, but the combination of Laravel Telescope in local-only mode (see: https://laravel.com/docs/9.x/telescope#local-only-installation) and the default config of this package could result an error when generating the docs:
Steps To Reproduce:
composer install --no-dev
to exclude development packages..env
.l5-swagger:generate
and see error.Cause
When running Laravel Telescope in local only mode, the package won't be installed on any other environment than local. The TelescopeServiceProvider won't be loaded, but still extends a non-existing class (from the Laravel Telescope package). The error occurs because the default config of this package scans the whole app folder, so also this service provider.
Possible solution
A few possible solutions might be:
I am uncertain if this package should do anything about this, but at least this issue might help some (and probably my future self) with solving that error.