Quantcast
Viewing latest article 30
Browse Latest Browse All 37

Answer by Mohamed Mufeed for How to deserialize a Laravel Eloquent model, i.e. reverse toArray(), attributesToArray() or toJson()?

I know it's old but if anybody is still looking for it.

Maybe you are trying to do the fill operation.

Eg:

$user = ['name' => 'Foo Bar','email' => 'foo@bar.com',];$userModel = new User();$userModel->fill($user);// If you want to save this then -> $userModel->save();

Viewing latest article 30
Browse Latest Browse All 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>