I have a form that accepts data that will be used to create two new database table records. The form accepts both user data and their address. User data will be saved using the User::create(Input::all()) method in the users table, and address data will be saved using the Address::create(Input::all()) method in the database address table.
The problem that I am currently facing is that Eloquent complains that the street, city, country, etc. does not exist in the user table. It is true that data should be used for the address side of things.
Is there a way to eloquently ignore irrelevant data in the Input::all() array when passing to creation methods?
Ps I know mass assignment is not a good idea, I use it here to simplify my question.
source share