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:
Hessel Bierma 2020-09-18 17:41:02 +02:00 committed by GitHub
parent 6832de38bb
commit da3bdaedba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.