Fixes for showing recurring invoices in the client portal

This commit is contained in:
David Bomba 2020-10-16 07:35:15 +11:00
parent f8eeccc44e
commit 07cbb6a71a
4 changed files with 8 additions and 3 deletions

View File

@ -17,6 +17,7 @@ use App\Events\Misc\InvitationWasViewed;
use App\Events\Quote\QuoteWasViewed;
use App\Http\Controllers\Controller;
use App\Models\InvoiceInvitation;
use App\Models\RecurringInvoiceInvitation;
use App\Utils\Ninja;
use App\Utils\Traits\MakesDates;
use App\Utils\Traits\MakesHash;

View File

@ -50,7 +50,7 @@ class RecurringInvoiceInvitation extends BaseModel
*/
public function contact()
{
return $this->belongsTo(ClientContact::class)->withTrashed();
return $this->belongsTo(ClientContact::class, 'client_contact_id', 'id')->withTrashed();
}
/**

View File

@ -11,6 +11,8 @@
namespace App\Utils\Traits;
use Illuminate\Support\Str;
/**
* Class Inviteable.
*/
@ -42,7 +44,9 @@ trait Inviteable
public function getLink() :string
{
$entity_type = strtolower(class_basename($this->entityType()));
//$entity_type = strtolower(class_basename($this->entityType()));
$entity_type = Str::snake(class_basename($this->entityType()));
//$this->with('company','contact',$this->entity_type);
//$this->with('company');

View File

@ -31,7 +31,7 @@ Route::group(['middleware' => ['auth:contact', 'locale'], 'prefix' => 'client',
Route::get('invoices/{invoice_invitation}', 'ClientPortal\InvoiceController@show')->name('invoice.show_invitation');
Route::get('recurring_invoices', 'ClientPortal\RecurringInvoiceController@index')->name('recurring_invoices.index')->middleware('portal_enabled');
Route::get('recurring_invoices/{recurring_invoice}', 'ClientPortal\RecurringInvoiceController@show')->name('recurring_invoices.show');
Route::get('recurring_invoices/{recurring_invoice}', 'ClientPortal\RecurringInvoiceController@show')->name('recurring_invoice.show');
Route::get('recurring_invoices/{recurring_invoice}/request_cancellation', 'ClientPortal\RecurringInvoiceController@requestCancellation')->name('recurring_invoices.request_cancellation');
Route::post('payments/process', 'ClientPortal\PaymentController@process')->name('payments.process');