gecche / laravel-multidomain

A Laravel extension for using a laravel application on a multi domain setting
MIT License
838 stars 105 forks source link

artisan domain:add command issue #79

Closed asifu5057 closed 2 years ago

asifu5057 commented 2 years ago

Hello,

I am using Laravel 8.12 and gecche/laravel-multidomain 4.0

When I run command php artisan domain:add mysite.com it throw below error message

cannot use a scalar value as an array at vendor/gecche/laravel-multidomain/src/Foundation/Console/AddDomainCommand.php:135

Please help how can I fix this issue?

Thanks, Asif

gecche commented 2 years ago

Hi,

it seems that there is a problem with your domain.php config file: within that config array there must be present the domains entry and it must be an array.

It seems that you have a scalar value for that entry instead of an array

Let me know if this helps

Cheers

Giacomo

asifu5057 commented 2 years ago

Thank you but currently domain.php file is empty, what should I add there? there is no instructions?

gecche commented 2 years ago

Have you ran the vendor:publish command as reported in the instructions?

asifu5057 commented 2 years ago

Yes I have ran that command.

asifu5057 commented 2 years ago

which provider I should publish after running the command? can you please guide me?

gecche commented 2 years ago

Ok... I think that something happened when you ran that command, maybe you already had a domain.php file in your config dir.

You can try to rerun that command with the option --force: it should overwrite the current config file.

Alternatively, you get the right config file in the vendor folder:

vendor/gecche/laravel-multidomain/src/config/domain.php

simply copy it in the config dir.

Then I think it should work

Giacomo

asifu5057 commented 2 years ago

Yes there was some issue in running the command, I rerun and publish all files by pressing the 0, all providers successfully published and now its working fine. Thank you @gecche