You are overriding your save method with a create method. Override create instead. Or even better, use a setter, a listener or a user creator service depending on your needs.
You should definitely research these concepts on your own and what I'm going to describe is probably not the cleanest way to go about it but it'll set you in the right direction and depending on the size of your project it could work just fine.
listeners.php
User::creating(function($user) {
$user->customfield = 'something';
// custom logic that needs to happen on user creation
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community