Laravel Many-to-Many: Extra Fields in Pivot Table

Laravel Many-to-Many: Extra Fields in Pivot Table

Laravel Daily

3 года назад

36,450 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

FrTrash
FrTrash - 12.04.2023 22:53

What if i want to edit these records? Is it possible? Should i use an id to directly edit those records?

Ответить
Jakov Pavlov
Jakov Pavlov - 08.02.2023 18:00

What if the extra field is another relation?? I mean think about this, in a project any user can be assigned to multiple projects, and in every project there are multiple users, but each user might have a different role in every project, so the pivot table would be: project_id | user_id | role_id

Ответить
Thomas Potter
Thomas Potter - 06.02.2023 02:07

What about the weight data per days? Should I create another table or just use json column?

Ответить
Vinícius Tavolaro
Vinícius Tavolaro - 17.01.2023 20:44

damn man u really is the goat, thank u so much

Ответить
Ricardo Diez
Ricardo Diez - 11.11.2022 08:03

Hi!!!! this video safe my life :D , I finally understand about custom fields on pivots table, but i have a question how i can save custom values of pivot table from json-api endpoint? do you have any example for this kind of case ?

Ответить
Shuoyan Pei
Shuoyan Pei - 21.10.2022 10:31

Hello can you make a grocery list to containt the ingredients pf the recipe selected please

Ответить
Eloquent
Eloquent - 13.10.2022 22:51

Thank you! It really helped me!

Ответить
maxwell maragia
maxwell maragia - 24.07.2022 18:10

This was a life safer for a critical bug at my company. Thanks man

Ответить
Abdelghafour Ghribil
Abdelghafour Ghribil - 01.05.2022 11:05

How to use setter in pivot model?

Ответить
Kelvin Murithi
Kelvin Murithi - 21.03.2022 13:02

Hello sir nice video kindly do a video on how you store ingredients and recipe_id on the pivot table

Ответить
Enrique Robledo
Enrique Robledo - 23.02.2022 23:08

this is kind of tricky to do in livewire, for create/edit actions, maybe an idea for a new video?

Ответить
Roberto Santana
Roberto Santana - 13.02.2022 21:46

Thanks a lot!

Ответить
Древо Жизни
Древо Жизни - 01.02.2022 17:14

Thanks a lot!

Ответить
Om He
Om He - 06.01.2022 09:07

how to update the ingredient value in edit page?

Ответить
boo monkey
boo monkey - 14.12.2021 22:32

Thank you so much! After I understood how sync works I write my code for processing arrays and it worked

Ответить
Josue Barros
Josue Barros - 12.09.2021 23:23

I was trying to do another project but this time: Laravel API and Vue SPA.

I followed the steps on the video, but couldn't find a way to insert the "quantity" on the pivot table via Insomnia.
PS: the pivot has 3 fields: order_id, product_id, quantity.

Ответить
Josue Barros
Josue Barros - 08.09.2021 22:04

I have a pivot table: negotiation_user with
negotiation_id and user_id

Is it possible to add project_id between them and add via attach()?
PS: project_id is a third foreign key

Ответить
BadKing👑
BadKing👑 - 06.09.2021 12:46

this solved my issue thank you so much

Ответить
Miftakhusy Syiroth
Miftakhusy Syiroth - 26.08.2021 05:04

if amount is integer, what is the query to sum total amount in soup?

Ответить
Digital Universe
Digital Universe - 19.07.2021 17:54

Thanks for the amazing video Mr povilas. Just noticed you using In array and old value In case of validation error. How does it work on select 2 drop down ? Could you please send the full snippet for the select 2 for ingredients dropdown?

Ответить