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

[5.8] Use real classname for seeders #29601

Merged
merged 1 commit into from Aug 16, 2019

Conversation

@jerguslejko
Copy link
Contributor

commented Aug 16, 2019

This way, if a programmer decides to override (example below) a seeder in a container, an actual class name is printed instead of the parent class name.

Example:

I'm working on a multi-tenant app, where each tenant has its own "configuration" folder (contains a service provider and some additional classes such as seeders for example). I can choose which configuration is enabled by tweaking an environment variable.

class PostsSeeder {}

class TenantAPostsSeeder extends PostsSeeder {}

With this change, I'll be able to tell which seeder is actually being executed when I run php artisan db:seed

Use real classname for seeders
This way, if a programmer decides to override (example below) a seeder in a container, an actual class name is printed instead of the parent class name.

Example:

I'm working on a multi-tenant app, where each tenant has its own "configuration" folder (contains a service provider and some additional classes such as seeders for example). I can choose which configuration is enabled by tweaking an environment variable.

```php
class PostsSeeder {}

class TenantAPostsSeeder extends PostsSeeder {}
```

With this change, I'll be able to tell which seeder is actually being executed when I run `php artisan db:seed`

@taylorotwell taylorotwell merged commit e78af62 into laravel:5.8 Aug 16, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jerguslejko jerguslejko deleted the jerguslejko:patch-1 branch Aug 16, 2019

@antonkomarev

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

@jerguslejko Thank you for that feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.