Skip to content

Commit 1dcc08b

Browse files
authored
Merge pull request tenancy#45 from bradenkeith/patch-2
Updated tinker documentation to read better
2 parents b1abbf3 + 2af4a32 commit 1dcc08b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/hyn/5.2/tinker.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ icon: fal fa-screwdriver
55

66
# Tenant Aware Tinker Command
77

8-
This tinker documentation will allow you to extend the tinker command and make it tenant aware.
8+
This article describes how to enable tenant awareness for the native Laravel tinker command.
99

10-
First create a trait named `MutatesTinkerCommand.php` with the following content:
10+
First, create a trait named `MutatesTinkerCommand` with the following content:
1111

1212
```php
1313
<?php
@@ -73,10 +73,9 @@ trait MutatesTinkerCommand
7373
}
7474
}
7575
```
76+
You can only tinker on one database at a time, therefore, the `website_id` needs to be a required option. Utilizing the `AddWebsiteFilterOnCommand` trait available in the Tenancy package would not work in this instance; it is tailored to run processes on multiple websites and makes the `website_id` parameter optional.
7677

77-
We didn’t opted on using the `AddWebsiteFilterOnCommand.php` trait available in the Tenancy package since you can only tinker on one database at a time and the `website_id` needs to be a required option. The `AddWebsiteFilterCommand` is tailored for multiple websites and that the `website_id` is optional.
78-
79-
Second, create a new console command `TinkerCommand.php` that uses the trait above.
78+
Second, create a new console command `TinkerCommand` that uses the trait above.
8079

8180
```php
8281
<?php
@@ -117,7 +116,7 @@ class Kernel extends ConsoleKernel
117116
}
118117
```
119118

120-
Now we have created a new `tenancy:tinker` artisan command. The `tenancy:tinker` requires the `--website_id=` option as a parameter. So, in order to run tinker on, let’s say, `website_id` of 1 you’ll need to run:
119+
Now we have created a new `tenancy:tinker` artisan command. The `tenancy:tinker` requires the `--website_id=` option as a parameter. So, in order to run tinker on, let’s say with a `website_id` of 1, you’ll need to run:
121120

122121
`php artisan tenancy:tinker --website_id=1`
123122

0 commit comments

Comments
 (0)