samedi 15 octobre 2022

How to make polymorph registration in Laravel?

The design system provides three types of accounts: client, carrier, seller. Each one has own set of fields like name, direction, minprice.

Here is a register controller with register method.

public function register(Request $request) {}

Should I split that method on three methods by account type? Another way is create a three services and factory. The account type must have own validations rules, model etc.

Which way to choose to be flexible?

Aucun commentaire:

Enregistrer un commentaire