1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Http/Livewire/RecurringInvoiceCancellation.php
Benjamin Beganović c0f5780172 wip
2021-04-08 17:11:14 +02:00

39 lines
927 B
PHP

<?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');
}
}