Flex's avatar
Level 4

how to create data table in My Laravel app?

hello, I am going to develop Auto Classified advertisement system using laravel. in My application there are six different vehicle types as,

car/van
Motor Bike
Lorry/bus
SUV
Boat
heavy Machinery

when some user is going to post an ad under one of above category there are some common columns name and some different columns values in the form, as an example consider car/van category. in this form have following form filling values

states
town
brand
series
transmission_type
millage
color
fuel_type

and consider some ad under heavy machinery category, form

states
town
brand
engine_size
bucket_size

you can consider there are some common columns name like states,town,brand and some different columns name values. so, I am planning to save same columns name values as ads_info table and other different columns values to vehicle_info table in the same form. but My problem is how can I create vehicle_info table architecture. i have no an idea about this. can you give me some solutions?

0 likes
3 replies
Yorki's avatar

You might think of using non-relative database like mongoDB. However if you want to use relative one you probably have three options

  • separate table for each model
  • one table with all cars, but containing only type of car and for each car type different table with columns you need for specs
  • one table with all cars, but containing only type of car and one table with cars specs having columns car_id, spec, value
Flex's avatar
Level 4

@Yorki I need your 3rd option. but I have not idea to create data table. how can I save this data I mean some array... or some thing I need some guide.... it is great help

Flex's avatar
Level 4

No any idea about this matter

Please or to participate in this conversation.