iamjaime / laravel-user-credits

23 stars 6 forks source link

How to create new credits #1

Closed williamfromtexas closed 5 years ago

williamfromtexas commented 5 years ago

Hi

Thanks a lot for this, I've been looking for a credit/prepaid system for Laravel Spark! I followed your steps and I believe it is installed correctly - didn't get any errors until I tried to use the functions.

I can't figure out how to add new credits. In the readme you mention displaying and updating credits. When I try to add credits for a user who does not have anything (the user_credits table is new and empty), I get an error that $amount is not an object.

I see you put a create function in the code. Can you provide an example code snippet for how that works?

Cheers

williamfromtexas commented 5 years ago

I realized the create function loops in for all new users, which is cool. For an existing user (admin!) I added some values to the table by hand.