Using the Illuminate\Contracts\Support\Responsable interface we could create classes that many people call dedicated view objects that encapsulate all the logic necessary for a specific response; in this case, our transaction.create view.

https://wilburpowery.dev/the-laravel-responsable-interface/?s=09