jeudi 30 août 2018

Laravel Cashier Subscriptions for Featured Posts

I am currently using Laravel Cashier for my users so they can subscribe for premium accounts.

I also want to let any user make Featured Posts that are different from regular posts.

I want to charge the user $10/week for a featured post. I assume a Laravel Cashier subscription would work for this.

But I do not know how to link the Post, the User, and the Subscription together with Laravel Cashier.

Ideally there would be a post_id field in the subscriptions table. But there is not.

I need a way to check if a post is a featured post and if the user who owns the post has paid for it (the subscription is active)

With Laravel Cashier I can check if a user is subscribed for a premium account, but I don't know how to check if a post is subscribed to be featured by the post owner.

Does anyone know how this can be done?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire