Eloquent Product Repository example #730
-
Hi, I'm trying to store Statamics data (products, customers and orders for now) in a mysql database. Customers and orders are working now, but I'm not sure if need to make my own repository for products. I might be missing something here but I can't find an example of a product repository to save products in the database. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, the built-in Eloquent Repositories will only move customers & orders in the database, not products as most folks will want to keep them as collections so they can be version controlled. If you do want to move products to the database though, then here might be some points of reference for you:
And if you wish to edit products in the Control Panel, you'll need to make them editable via Runway |
Beta Was this translation helpful? Give feedback.
Yes, the built-in Eloquent Repositories will only move customers & orders in the database, not products as most folks will want to keep them as collections so they can be version controlled.
If you do want to move products to the database though, then here might be some points of reference for you:
EntryProductRepository
- the repository for products stored as entriesEloquentOrderRepository
- the repository for orders stored in the databaseOrderModel
- the Eloquent model for ordersAnd if you wish to edit products in the Control Panel, you'll need to make them editable via Runway