1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00
invoiceninja/app/Http/Livewire/RecurringInvoiceCancellation.php

39 lines
927 B
PHP
Raw Normal View History

2021-04-08 17:11:14 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Livewire;
use App\Models\RecurringInvoice;
use Livewire\Component;
class RecurringInvoiceCancellation extends Component
{
/**
* @var RecurringInvoice
*/
public $invoice;
public function processCancellation()
{
if ($this->invoice->subscription) {
return $this->invoice->subscription->service()->handleCancellation();
}
return redirect()->route('client.recurring_invoices.request_cancellation', ['recurring_invoice' => $this->invoice->hashed_id]);
}
public function render()
{
return render('components.livewire.recurring-invoice-cancellation');
}
}