Comments (3)
I have tagged v1.2.0
from jetstream-cashier-billing-portal.
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.
@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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetstream-cashier-billing-portal.