2
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasOne;
use Laravel\Cashier\Subscription as CashierSubscription;
use App\Http\Traits\Unique;

class Subscription extends CashierSubscription
{

}

I need to add some custom data into the subscription when it's created.

I've created the extra table in the Cashier Migrations,

$table->string('address')->nullable();
$table->string('team')->nullable();

When running,

return $request->user()
    ->newSubscription('default', 'price_monthly')
    ->checkout();

I need to be able to set those values from newSubscription.

What would be the most effective way of doing this?

I've tried via fillables and controller but it becomes very messy.

tews-nees
  • 51
  • 3

0 Answers0