laravel - One controller and inserting data into more than one table (Mass Assignment) -


i have website users can send product (like car, mobile, computers) , sell online on website, maybe ebay , amazon.

i have ads table store public information 1 thing using mass assignment, , other categories mobile, car , computers have own table , store professional , additional information of category on (for example cars have additional information color, fuel type, guaranty, accidents,insurance).

now know (for mobile) have 2 tables (ads , ads_mobile), , forms have controller adscontroller , ads model, form create dynamically , each form has own inputs (for example:mobile , car has different inputs , fields), , send dynamic forms adscontroller@check , check kind of form (is mobile? car? or ...?) , send data model:

//adscontroller(this example);  class ad extends eloquent {    protected $fillable_ads = array('field_one', 'field_two', 'field_three');  }   class mobile_ad extends eloquent {    //and want use fillable_mobile_ads    protected $fillable_mobile_ads = array('field_one', 'field_two', 'field_three');  } 

how send data 1 controller 2 models?

is possible?

how should model , controller (suggestion)?

any suggestion structure of website?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -