Laravel Cashier Mollie V1 Is Now Available

Laravel Cashier Mollie V1 Is Now Available

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!

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:

namespace App\Http\Controllers;

use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;

class CreateSubscriptionController extends Controller
{
    /**
     * @param string $plan
     * @return \Illuminate\Http\RedirectResponse
     */
    public function __invoke(string $plan)
    {
        $user = Auth::user();

        $name = ucfirst($plan) . ' membership';

        if(!$user->subscribed($name, $plan)) {

            $result = $user->newSubscription($name, $plan)->create();

            if(is_a($result, RedirectResponse::class)) {
                return $result; // Redirect to Mollie checkout
            }

            return back()->with('status', 'Welcome to the ' . $plan . ' plan');
        }

        return back()->with('status', 'You are already on the ' . $plan . ' plan');
    }
}

We’d like to congratulate Sander and the Laravel team for this exciting accomplishment!

Filed in: News / packages

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Full Stack PHP Developer (Laravel)
Remote
MAPPEN
Senior Laravel Developer
Remote
ACTO
Senior Full-Stack Engineer
[REMOTE: USA Only]
Curricula
Developers for B2B eCommerce SaaS, AWS serverless, Laravel, Vue, Python
Remote, full time EU only
ES Tech Group
Senior PHP Developer (Laravel)
Remote
The Interaction Design Foundation