You might recall we wrote about Subscription billing with Laravel Cashier for Mollie a while back during the early stages of development. We have good news: Laravel Cashier for Mollie officially released version 1.0 earlier this week!
Ready to rock & roll!
Here is laravel/cashier-mollie v1.https://t.co/aAw7VNCHYR
Enjoy
@laravelphp @MolliePayments
— Sander van Hooft (@SandervHooft) September 3, 2019
Laravel Cashier for Mollie is a first-party Laravel Cashier package—created and maintained by Sander van Hooft —which provides an expressive, fluent interface to subscriptions using Mollie’s billing services. This package is a massive win for working with European customers.
You can learn more about this package, get full installation instructions, and view the source code on GitHub at laravel/cashier-mollie.
To give you a quick preview of the ease of working with this package here’s a basic controller example for creating a subscription from the readme:
1namespace App\Http\Controllers; 2 3use Illuminate\Http\RedirectResponse; 4use Illuminate\Support\Facades\Auth; 5 6class CreateSubscriptionController extends Controller 7{ 8 /** 9 * @param string $plan10 * @return \Illuminate\Http\RedirectResponse11 */12 public function __invoke(string $plan)13 {14 $user = Auth::user();1516 $name = ucfirst($plan) . ' membership';1718 if(!$user->subscribed($name, $plan)) {1920 $result = $user->newSubscription($name, $plan)->create();2122 if(is_a($result, RedirectResponse::class)) {23 return $result; // Redirect to Mollie checkout24 }2526 return back()->with('status', 'Welcome to the ' . $plan . ' plan');27 }2829 return back()->with('status', 'You are already on the ' . $plan . ' plan');30 }31}
We’d like to congratulate Sander and the Laravel team for this exciting accomplishment!
0 comments:
Post a Comment
Thanks