mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
updates for tinker commands Laravel 8 (#84)
Small update to the last command to populate the users table when using Laravel 8.
This commit is contained in:
parent
6832de38bb
commit
da3bdaedba
1 changed files with 8 additions and 0 deletions
|
|
@ -174,6 +174,14 @@ App\Tenant::all()->runForEach(function () {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you use Laravel 8, the the command is slightly different:
|
||||||
|
|
||||||
|
```php
|
||||||
|
App\Tenant::all()->runForEach(function () {
|
||||||
|
User::factory()->create();
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## Trying it out {#trying-it-out}
|
## Trying it out {#trying-it-out}
|
||||||
|
|
||||||
Now we visit `foo.localhost` in our browser and we should see a dump of the users table where we see some user. If we visit `bar.localhost`, we should see a different user.
|
Now we visit `foo.localhost` in our browser and we should see a dump of the users table where we see some user. If we visit `bar.localhost`, we should see a different user.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue