2 months ago

conditional redirect

Posted 2 months ago by Chron

For example, I have People, Accounts, and Products.

All of them have their controllers, models and tables.

But the user can only create products when both people and accounts are not empty.

So, the user will be redirected to route('people.create') if the user went to route('product.create') but peoples table is empty

So, If the user has completed creating people record, it will be redirected back to route('product.create').

Is there a way to check whether the user went to the page because of redirection or just a normal navigation?

Please sign in or create an account to participate in this conversation.