Reputation: 51
I am new to laravel I want to integrate subscription module in my project as I followed the following process till now.
composer require laravel/cashier
php artisan vendor:publish --tag="cashier-migrations"
Update User Model
use Laravel\Cashier\Billable;
class User extends Authenticatable
{
use Billable;
}
.env
CASHIER_MODEL=App\Models\User
Need suggestions where I am going wrong.
Upvotes: 3
Views: 1056
Reputation: 61
I also had the same problem. I closed my IDE and restarted it and the error was gone. - sharad paudel
EDIT: I can confirm that restarting VS Code is a solution to this problem. I'm also using Laravel / Cashier, and I came across a similar situation. VS Code was giving me the red squiggly lines inside the actual Billable trait file: src/vendor/laravel/cashier/src/Billable.php
similar to the OP. It seems like it isn't an "error" so much as a minor confusion in VS Code - I had all the correct "use" import lines.
After restarting VS Code, all file associations seemed to be fine, and all the red squiggles were gone.
I have also seen this happen before, after installing something with "composer", a restart was needed to make VS Code happy. -dogatonic
Upvotes: 5
Reputation: 192
Add Billable
after using the comma (,
); use HasApiTokens
, HasFactory
, Notifiable
. Write it like
use HasApiTokens, HasFactory, Notifiable, Billable;
Upvotes: 1