I asked a question like this and got advice, so I used it to define tables and relations .Environment
I can't tell if the relationship with the primary key/foreign key table in Laravel is correct, so please point out that the expected behavior has been made.
Because it doesn't make a decision, because the toTo is established with the business_hours table facilities table in the ER diagram output by the Laravel Entity Relation Diagram Generator, it seems that the HasMany relationship does not hold.
I want to pick up open and close from the Facility model, that is, I want to make it possible to get the business hours of the facility from the facility ID (facilites ID), although the table that registers the facility and business hours is separated That's it.
It looks like there is no problem when I look at the image verified with tinker, but I was worried about the above and asked the question.
The password_reset part of the ER diagram output by the Laravel Entity Relation Diagram Generator is just the default when Laravel's Auth authentication is introduced.
I will add that the question is difficult to understand.
From Previous Question to a simple wireframe and activity diagram for a system that expects to use the ER diagram for this question add to.
Tokyo Sports Facility Service
I want to make the following system based on the registration part of the above URL from the date and time of use.Simple wireframe Simple activity diagram related to the question I want to ask this time
The ER diagram I'm assuming is trying to make the above system, but the image is 3 images, but if you look at the 4th image (the library that shows the relationship after migration with Laravel), bussiness_hours belongsTo facilities The question is whether there is no problem at first glance as if the relationship of facilities hasMany bussiness_hours is established.
Regarding the comment
Does that mean that the parent table and child table have one-to-one data?
Doesn't that mean you don't need to normalize it?
, the table is divided by facilities and bussiness_hours. It is the result of receiving advice that it is better to create a separate business hours table and relate it to the facility table.
In addition, I received a comment from the respondent of the previous question a while ago, and id that is not an Integrer should be set to Integer or BigInteger, and should be auto-incremented again, so we are considering it again.
This is the first time I have carefully considered the definition and design of a table in creating a deliverable in a month of Laravel, so in the first place I was advised about the possibility that the concept of relations is wrong and the advice I received in the previous question I'm very sorry that I didn't understand it and couldn't interpret it wrongly.
Answer # 1
I don't think it makes sense to say that I answered the last time, but it looks like there is no problem with the current ER.
Laravel Entity Relation Diagram Generator
I ’ve never used this, so I guess it ’s speculation. Isn't BelongsTo, HasMany etc. generated from Model information?
But I think that it is better to auto-increment with integer/biginteger type according to Laravel
- mysql - how to format 100 million data in laravel and put it in a table
- php - how to get user name from laravel relation offer table
- reflection of table definition in mysql by laravel migration does not work well
- mysql - [laravel] how can i make an outer join in a many-to-many table?
- mysql - [sql] cannot create table
- mysql - laravel review function
- mysql - select * from contents are not displayed even if the table name is displayed
- php - transaction with overwriting db table does not work mysql
- php - if there is data in the db table with mysql, please tell me how to insert if there is no update
- php - save table information created by laravel auth in db
- i want to create a log table in mysql
- mysql table creation error code 1064
- i want to connect mysql and php and create a table with the create statement
- mysql - i don't know why the id of the intermediate table is different when i hit the console
- mysql - external table is denormalized and displayed by sql select
- Basic tutorial of MySQL partition table
- MySQL partition table best practice guide
- About MYSQL you need to know the data type and operation data table
- mysql ranking table design
- php : Assistance in the implementation of regular bus services
- i want to display the image registered in the database with laravel
- mysql - i want to unify the date types created in wordpress custom fields
- php - how to get the last row of db and the process that is not related to the user's operation with laravel
- mysql - about database design and implementation
- laravel and mysql connection
- php - [laravel] relationed data cannot be displayed in blade
- php - mysql insert limit
- mysql2 :: error :: connectionerror when trying to auto-deploy with bundle exec cap production deploy
- mysql - access denied for user error in xserver