[Bug] Uses migration when generating map
INIFREY opened this issue · comments
Hello. When you try to cache maps I have an error.
php artisan morphmap:cache
PHP Fatal error: Cannot declare class CreateSitemapPermissions, because the name is already in use in /project/Modules/Sitemap/Database/Migrations/2019_02_11_124256_create_sitemap_permissions.php on line 35
Symfony\Component\Debug\Exception\FatalErrorException : Cannot declare class CreateSitemapPermissions, because the name is already in use
Logically, a morph map should be created only for entities and not related to migrations.
laravel-auto-morph-map 2.1.0
laravel 5.7
php 7.1.3
My apologies that this is taking sooo long to be looked at. It's on my planning, but haven't got to it yet.
Could you perhaps post the autoload section of your composer.json and your morph map config file (if you're using a custom one)? Have a feeling the migrations folder is included in the namespace autoload section.
Will close this issue as I need more information to debug this, but it's related to autoloading. Feel free to respond with the requested info and I'll take a look.