Giter Site home page Giter Site logo

Comments (3)

rennokki avatar rennokki commented on May 13, 2024 1

I have tagged v1.2.0

from jetstream-cashier-billing-portal.

benferns avatar benferns commented on May 13, 2024

I've been doing some thinking on this and I can see how its a bit tough to know which model in particular (if its not the user). I'm not the most-experienced laravel coder, so I may be missing standardised approaches to this kind of problem.

Maybe an option to allow setting of the model via the route params, to allow the dev in question to link correctly? Or an overridable ->billableModel() method on User via a trait that returns the specific cashier model they want (though it could be awkward if the billable model is in no way linked to particular users)?

For now I've taken a hacky approach with my project, duplicated the controllers and replaced all $request->user() calls with $request->user()->currentTeam and that got me 95% of the way there since most of the Billable Model references are generic. (I suspect options for Team and User models would actually cover 80%+ of use-cases).

Thanks for the work on the project - its invaluable being able to move off of Spark while they are in limbo.

from jetstream-cashier-billing-portal.

rennokki avatar rennokki commented on May 13, 2024

@60days How about configuring it directly in the service provider. Something like:

BillingPortal::setBillable(function ($request) {
    return $request->user()->currentTeam; // $request->user() by default
});

from jetstream-cashier-billing-portal.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.