Using a Laravel pipeline is always nice to structure a process like this.
PHP
Improving Laravel Architecture With Expressive
Learn how Expressive can improve a Laravel application by keeping Eloquent as the database layer while moving business logic to fully typed objects. Read more