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
Merged

[5.8] Use real classname for seeders #29601

merged 1 commit into from
Aug 16, 2019

Conversation

jerguslejko
Copy link
Contributor

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

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
@jerguslejko jerguslejko deleted the patch-1 branch August 16, 2019 13:54
@antonkomarev
Copy link
Contributor

@jerguslejko Thank you for that feature!

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

Successfully merging this pull request may close these issues.

3 participants