Closed Benoit1980 closed 4 years ago
$user = User::where('id',Auth::id())->get();
This doesn't return a user, it returns a collection of users. You need $user = User::firstWhere('id',Auth::id());
Thanks! I think some updates must have been released for the migrations because I have a missing column in my subscription column as I am getting this for:
$nextPayment = $user->subscription('default');
return view('backend.customer.orders.view', ['nextpayment', $nextPayment]);
Illuminate\Database\QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'subscriptions.billable_id' in 'where clause' (SQL: select * from `subscriptions` where `subscriptions`.`billable_id` = 48 and `subscriptions`.`billable_id` is not null and `subscriptions`.`billable_type` = App\User and `name` = default order by `created_at` desc limit 1)
And when I pass a subscription order, I keep having this:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billable_id' in 'field list' (SQL: insert into `subscriptions` (`name`, `paddle_id`, `paddle_plan`, `paddle_status`, `quantity`, `trial_ends_at`, `billable_id`, `billable_type`, `updated_at`, `created_at`) values (default, 4608459, 622049, active, 1, ?, 48, App\User, 2020-09-27 19:16:06, 2020-09-27 19:16:06)) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billable_id' in 'field list' (SQL: insert into `subscriptions` (`name`, `paddle_id`, `paddle_plan`, `paddle_status`, `quantity`, `trial_ends_at`, `billable_id`, `billable_type`, `updated_at`, `created_at`) values (default, 4608459, 622049, active, 1, ?, 48, App\\User, 2020-09-27 19:16:06, 2020-09-27 19:16:06)) at
Both showing the billable_id being missing.
Think you're still on an old beta release.
oh ok, is there a way to have access to the new migrations since the Beta or do I need to delete everything instead and restart a fresh installation? Thank you.
Fresh is probably the best idea since a lot has changed since the early beta's.
Thank you so much for the fast reply. Will do :-)
Hello,
When following the doc here: https://laravel.com/docs/7.x/cashier-paddle#past-and-upcoming-payments
By doing this:
I am getting:
Any idea why please?
Thank you.