Composer Downloads The Package And Put In The Vendor Map But The Service Provider Doesn't Recognize It Laravel 6
I forked an api handler from git that I need to update to be laravel 6 (api handler that i forked what is not laravel 6 compatible) compatible but I keep getting composer errors
So when I run composer update
it install the package from the git and put it correctly on in the vendor folder. what works fine then I add the class to the config/app.php
like this
'providers' => [
Name\ApiHandler\ApiHandlerServiceProvider::class,
],
what will throw this error in laravel
In ProviderRepository.php line 208:
Class 'Name\ApiHandler\ApiHandlerServiceProvider' not found
so far I have tried:
composer clear-cache
rm -rf .cache/composer/*
- clear the bootstrap composer
- delete
composer.lock
- delete the
vendor
and then after that composer update
but it keeps throwing the error. But when I am in mine editor and go to the config/app.php
and click on Name\ApiHandler\ApiHandlerServiceProvider::class,
while holding ctrl it finds the class and goes to the vendor map so mine idea shows that the class is correctly imported
this is how the composer.json looks of the laravel project
"repositories": [
{
"type":"package",
"package": {
"name": "name/laravel-api-handler",
"version":"dev-laravel-6",
"source": {
"url": "https://github.com/name/laravel-api-handler",
"type": "git",
"reference":"branch name"
}
}
}
],
"require": {
"name/laravel-api-handler": "dev-laravel-6",
},
the api handler composer.json
"autoload": {
"psr-4": {
"name\\ApiHandler\\": "src"
}
},
"extra": {
"laravel": {
"providers": [
"name\\ApiHandler\\ApiHandlerServiceProvider"
]
}
},
the map structure is vendor/name/laravel-api-handler/src
also the the custom package doesnt show up in the Discovered Package
when running Composer update
or Composer install
Am I missing something because I cant figure out what is going wrong
Answer
So after doing research to editing custom packages into your project apparently composer doesn't autoload "type":"package"
what is not mentioned in there documentation anywhere. link where it get explained
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?