Comments (11)
2 other things:
- if person belongs to 1..n user e-mail should not be editable (at the moment it is readonly if person belongs to exact 1 user, if person belongs to >1 user it is not readonly)
- edit user in person edit form should not hidden if there is one than 1 user connected
from people.
We got to the point where we needed in our applications a way to handle people that don't have access in the app at some point, but may have in the future.
Once the People structure was created we wanted to normalize the database. Before having People, the personal details for users were kept in the users table.
Our intention is to have a One to One relation - the Person
model has a user()
relation, without an s
The implementation does not allow creating more than one user per person (from the interface) unless you do something "under the hood".
from people.
Ok. So the only missing thing is why the id of user is shown in people table and not the id of person.
from people.
the query behind PeopleTable
should be:
return Person::select(\DB::raw(
'people.*, people.id as "dtRowId", CASE WHEN users.id is null THEN 0 ELSE 1 END as "user"'
))->leftJoin('users', 'people.id', '=', 'users.person_id');
people.*
will select the id of the person. There is no user.id in this select.
the request response as I see it is:
{id: 1, company_id: 115, title: "Mr", name: "Administrator", appellative: "Admin", uid: "admin",…}
appellative: "Admin"
birthday: "24-10-2018"
company_id: 115
created_at: "05-10-2017"
created_by: null
dtRowId: 1
email: "[email protected]"
id: 1
name: "Administrator"
obs: "13132222"
phone: "456"
position: "test"
title: "Mr"
uid: "admin"
updated_at: "2019-01-25 10:47:10"
updated_by: 1
user: 1
where user:1
is a boolean flag.
Could you be more precise?
from people.
Response for the output above:
Really strange...
from people.
what's strange? You have two people, one with the id of 32 and one with 33.
from people.
from people.
from people.
1,2,3,4 is the current number :D
from people.
can we close this?
from people.
from people.
Related Issues (11)
- self::creating expects a person entry to already be present HOT 12
- Publish does not generate configuration file HOT 3
- self::creating expects a person entry to already be present HOT 5
- Binding custom person form has errors and won't let me create or edit anymore after update HOT 9
- create a People import
- Login - The device name field is required. HOT 1
- add screenshots HOT 2
- Creating a new person causes an update on every key-press
- Spelling correction: Mandatary should be Mandatory HOT 2
- Bindings for Validations HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from people.