Support the ongoing development of Laravel.io →
Database Eloquent Forms
Last updated 2 years ago.
0

malinga91 said:

how to do this with Laravel 5.3. I need to know how to insert data to user_cateogry_sector table using form

I think you need to take a step back and look at the big picture. I'm not entirely sure how your application works and what challenges it faces, but here're some things you can think about.

  1. user_category_sector, as you say, gives users access to certain categories and certain sectors. It has no access to application information at all.

  2. If we create a user_application table instead of the user_category_sector table, we can keep track of the applications the user has access to. This is good if your users' access permissions and application table doesn't change much. It's also easy for users to find what applications they have access to from just one(ish) table.

  3. If your users' access permission and application table constant changes (ie. one user will get sector_id 2 only for 3 days every month, and new applications are constantly added/updated), then it might be easier to NOT keep track of user permissions to applications at all. When they reach a controller for a certain application, get the category/sector id and check against the user_category_sector. There'll be a bit more work regarding listing application access, but it'll be easier than updating two, three tables every time there's a change.

That's just what I think, anyways.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

malinga91 malinga91 Joined 21 Jun 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.