B
B
BonBon Slick2016-12-31 12:32:03
MySQL
BonBon Slick, 2016-12-31 12:32:03

Laravel 5.3 save 1st model data across different tables?

I have a product and its details. Created 2 tables, product, which includes: id, name, slug, barcode. And the product_details table was created , which includes product details: id, product_id, description, brand, avatar, stock, price .... Of
course, you can take a specific part from $request- >name/slug/barcode and shove it into the product table, and similar do with another table. Although I'm wondering if there's another way.
The question is, are there any facilities for such a record in Laravel 5.3? (dividing the 1st model into multiple tables)
How would you do such a save?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-12-31
@BonBonSlick

https://laravel.com/docs/5.3/eloquent-relationship...
You can also look at associate in your BelongsTo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question