is there a shorter way to insert data in Laravel over the Eloquent ORM?
at the moment i'm doing it this way:
$newCustomerGsale = new CustomersGsale();
$newCustomerGsale->email = $gsalesCustomer->getEmail();
$newCustomerGsale->customerno = $gsalesCustomer->getCustomerNumber();
$newCustomerGsale->created = $gsalesCustomer->getCreated();
$newCustomerGsale->company = $gsalesCustomer->getCompany();
$newCustomerGsale->firstname = $gsalesCustomer->getFirstname();
$newCustomerGsale->lastname = $gsalesCustomer->getLastname();
$newCustomerGsale->save();
like you see all the columns are named like the attributes.
I know u can use the $request
object with all() function and fetch().
but I get the data from a other object (soap server).
is there a way to convert this? maybe over the model?
customerno
isn't. – brombeercreateFromSoapObject
– Bharat Geleda