Skip to content
Advertisement

Laravel 7 – Temporary Users

I’m kind of new in Laravel, so I want to know if someone can tell me the best way to implement a temporary user. I tried to add a variable that bring me the value of active and then try to added on the condition for each role, but it didn’t work. Somebody can help me?

  • I have this in my LoginController
JavaScript

In MySQL database I added an ‘active’ column of type ‘tinyint(1)’ in the table ‘users’. So I want to add a condition or something that validates if the user is active(1) or inactive(0). Also I would like to add it in the view where the user ‘admin’ can enable or disable a user with a checkbox.

  • Index view:
JavaScript

Advertisement

Answer

You can add 1 more condition.

JavaScript

Coming to second part of your question you can simple call an ajax when checkbox checked or un-checked.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement