Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to Docs... #120

Closed
santiagazo opened this issue Apr 7, 2021 · 1 comment
Closed

Add to Docs... #120

santiagazo opened this issue Apr 7, 2021 · 1 comment

Comments

@santiagazo
Copy link

I'm not sure of all the ins and outs of the file. I am not advanced enough to really do a great job describing how to do this, but it would be GREAT to add to the documentation how to call the tenants:run command with Artisan::call(). It is possible! I just figured it out, but it's not well documented and certainly it's something that someone else has had to figure out. I'd love to fork this repository and add it, but I'm not sure how to do it, git is not a strong point for me.

Anyway this is my use case if you want to use it as an example:

        Artisan::call('tenants:run', [
            'commandname' => "db:seed",
            '--tenants' => ["sample"],
            '--option' => ["class=SampleDatabaseSeeder"]
        ]);

The rough part for me was figuring out how to add the commandname argument as I found no documentation for it and because the vendor/stancl/tenancy/src/Commands/Run.php file has a kind of abstract name and because you can't just click through to it in the IDE ('tenants:run' = no clicky clicky) I didn't find it until I was able to get my code close enough that an error was thrown in it and a stack trace could help me find it.

The most difficult areas on this without documentation are:
Knowing to use the commandname argument
Knowing how to use the commandname argument (ie: NOT --commandname)
Knowing when to put the value in an array and when to not do it - (command name requires string while the options and tenants require an array.

So, if you feel it's warranted, I think it could be crazy helpful to others. If not, hopefully, I've put enough keywords in this post that someone else can find it. All the best and THANK YOU for such an incredible package.

@mirzazeyrek
Copy link

good catch I was also looking for this thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants