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

feat improve model factory after* methods #1195

Merged
merged 3 commits into from
Mar 23, 2022
Merged

feat improve model factory after* methods #1195

merged 3 commits into from
Mar 23, 2022

Conversation

mdpoulter
Copy link
Contributor

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Resolves #1131

Changes

As discussed in #1131, it looks like Laravel won't be making this change in the near future. This PR prevents errors such as this:

Parameter #1 $callback of method Illuminate\Database\Eloquent\Factories\Factory<Illuminate\Database\Eloquent\Model>::afterCreating() expects 
    Closure(Illuminate\Database\Eloquent\Model): mixed,
    Closure(App\Data\Models\Task): void given.

@szepeviktor
Copy link
Collaborator

Nice PHPStan error formatting 😍

@szepeviktor
Copy link
Collaborator

💊 GitHub needs medicine: https://www.githubstatus.com/incidents/83lq7ftk19r5

@szepeviktor
Copy link
Collaborator

kép

🤯 1 + 1 whole hours 🤯

@canvural canvural changed the title Improve model factory "after" methods feat improve model factory after* methods Mar 23, 2022
@canvural canvural merged commit 675d318 into larastan:master Mar 23, 2022
@canvural
Copy link
Collaborator

Thank you!

@mdpoulter mdpoulter deleted the factory-after-methods branch March 23, 2022 12:32
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.

afterCreating method does not accept Closure(Model)
3 participants