Jun 20, 2017
0
Level 4
Carbon problem in canceling subscription. Laravel Cashier
Hi. I'm facing a problem when canceling my subscription in my unit test. When I cancel the recently created subscriptions I get the following error
1) Tests\Feature\Business\UpdateBusinessTest::an_user_can_cancel_a_subscription
InvalidArgumentException: Data missing
/home/vagrant/Code/fram/vendor/nesbot/carbon/src/Carbon/Carbon.php:582
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:708
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:731
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:1009
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:980
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:935
/home/vagrant/Code/fram/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:510
/home/vagrant/Code/fram/vendor/laravel/cashier/src/Subscription.php:297
/home/vagrant/Code/fram/tests/Feature/Business/UpdateBusinessTest.php:44
Line 44 of is basically the following.
$business->subscription( 'main')->cancel();
Still not sure what is causing the problem. Maybe I'm forgetting something since I'm not using the User class as Billable model. The subscription is cancelled properly on Stripe, the problem is just really the save() method.
I have the proper fields in model's table.
Cheers
Please or to participate in this conversation.