How to create a Laravel Eloquent Model from Collection?
there is a hydrate
method for this:
YourModel::hydrate($collections->toArray())
But if you have only one object, you can just
$res = new YourModel($your_object)
Or you can even use fill
(new YourModel())->fill($your_obj)
And obviously until you don't call like save
or update
or something like this, where laravel tries to save that model on the DB, you're safe (maybe consider "disabling" them from the model, so that if you accidentally call those methods, nothing happens)