0

Intro: I'm fairly new to Laravel and MVC.

I am in a process of making all the front-end of the system, which setting up the controller and view files.

Now the system will have users, so I created UsersController for its CRUD, but instead of delete, the users can be archived and un-archive.

Archived users cannot logged in anymore, they will be separated from the database table where the active users are, they can also be un-archive incase they got employed in the future.

How should I tackle this? Any tips?

1 Answer 1

0

You do not need to separate users in different parts in database (back-end) side and application (front-end) side, in user table just put a column (status) and change the value of the status column whatever you want: e.g( 1: is archived users, 0: is un-archived users).

Sign up to request clarification or add additional context in comments.

4 Comments

typically this will be the case, but i wanted to separate them so that it will be faster to query active users and generate complicated reports such as payroll
There is no difference for query speed in this case, just in query you will put a condition to filter your users. It is not a good idea for one column, you duplicate a table.
sorry but there is, when record hit millions and 500k of them are supposed to be "archive" its really a boost in speed
You need to index the (status) field for speed optimization, its not a big problem. Check this stackoverflow.com/questions/3211108/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.