Eloquent model default values

Tryin’ to find a way to set default model values in Eloquent model (speaking about Laravel ORM) I was surprised that there’s no any mention about it in official docs. So thanks to fellas from StackOverflow such a workaround was found:

This example shows you how to set default value to ‘foo’ model property (model field, attribute, etc) if you’re creating a new FooModel record.

You could say that we can set default values in migrations but I prefer to say that migrations aren’t a part of application business logic. So in my case I define an user start balance after its registration. And I could change it simply changing the attributes array in the model.

Hope that will help you!

P.S. I’m still in search of better workaround pattern for my case — how to easily define users default data? Could I create new model named e.g. «AppConfig» to store app’s business logic config such as initial user data? Or it’s enough to define it in .env (sure it’s not a good idea).