mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
ab8b05dd56
* Install livewire/livewire * Table improvements - Cleanup of InvoiceController - Added Livewire package - New Livewire component (InvoicesTable) - New WithSorting trait - Removed rendering invoices from index.blade.php - Removed Yaryabox/Datatables references in InvoiceController * Refactor: Recurring invoices * payments table & sorting improvements * payment methods table * quotes table * credits table * Add turbolinks
67 lines
1.9 KiB
PHP
67 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Http\Controllers\ClientPortal;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Utils\Traits\MakesHash;
|
|
use App\Utils\Traits\MakesDates;
|
|
use App\Models\RecurringInvoice;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Notifications\ClientContactRequestCancellation;
|
|
use App\Http\Requests\ClientPortal\ShowRecurringInvoiceRequest;
|
|
|
|
/**
|
|
* Class InvoiceController
|
|
* @package App\Http\Controllers\ClientPortal\InvoiceController
|
|
*/
|
|
|
|
class RecurringInvoiceController extends Controller
|
|
{
|
|
use MakesHash;
|
|
use MakesDates;
|
|
|
|
/**
|
|
* Show the list of recurring invoices.
|
|
*
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
public function index()
|
|
{
|
|
return $this->render('recurring_invoices.index');
|
|
}
|
|
|
|
/**
|
|
* Display the recurring invoice.
|
|
*
|
|
* @param ShowRecurringInvoiceRequest $request
|
|
* @param RecurringInvoice $recurring_invoice
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
*/
|
|
public function show(ShowRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice)
|
|
{
|
|
return $this->render('recurring_invoices.show', [
|
|
'invoice' => $recurring_invoice->load('invoices'),
|
|
]);
|
|
}
|
|
|
|
public function requestCancellation(Request $request, RecurringInvoice $recurring_invoice)
|
|
{
|
|
//todo double check the user is able to request a cancellation
|
|
//can add locale specific by chaining ->locale();
|
|
$recurring_invoice->user->notify(new ClientContactRequestCancellation($recurring_invoice, auth()->user()));
|
|
|
|
return $this->render('recurring_invoices.cancellation.index', [
|
|
'invoice' => $recurring_invoice,
|
|
]);
|
|
}
|
|
}
|