bavix / laravel-wallet

It's easy to work with a virtual wallet
https://bavix.github.io/laravel-wallet/
MIT License
1.15k stars 230 forks source link

add to wallet creation save colum #236

Closed odion-cloud closed 4 years ago

odion-cloud commented 4 years ago

Hello i want to be a able to save three colum when creating user wallet i tried like this

$wallet = $user->createWallet([ 'name' => 'New Wallet', 'slug' => 'my-wallet', 'wallettype_id' => 'wallettype_id' ]);

but it only save name and slug left wallettype_id how do i do this

rez1dent3 commented 4 years ago

You need to overload the model and add a new field to the $fillable field.

https://github.com/bavix/laravel-wallet/blob/780270c42bdb9e4a57366f45148cc83d199bfe41/src/Models/Wallet.php#L44-L52

See https://laravel.com/docs/8.x/eloquent#mass-assignment

odion-cloud commented 4 years ago

You need to overload the model and add a new field to the $fillable field.

https://github.com/bavix/laravel-wallet/blob/780270c42bdb9e4a57366f45148cc83d199bfe41/src/Models/Wallet.php#L44-L52

See https://laravel.com/docs/8.x/eloquent#mass-assignment

thanks work