Use the 'afterMaking' or 'afterCreating' hooks in factories to execute additional logic

Use the 'afterMaking' or 'afterCreating' hooks in factories to execute additional logic

💡#Laravel Tip: Database model factories have handy 'afterMaking' and 'afterCreating' callback methods that you can use to perform additional tasks on newly-created objects.

We're writing a book, you can get it for free here.