1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 09:21:34 +02:00
invoiceninja/app/Http/Requests/ClientPortal/Statements/ShowStatementRequest.php

51 lines
1.2 KiB
PHP
Raw Normal View History

2021-09-15 17:23:07 +02:00
<?php
namespace App\Http\Requests\ClientPortal\Statements;
use App\Models\Client;
use Illuminate\Foundation\Http\FormRequest;
class ShowStatementRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
/**
* Prepare the data for validation.
*
* @return void
*/
protected function prepareForValidation(): void
{
$this->merge([
'show_payments_table' => $this->has('show_payments_table') ? \boolval($this->show_payments_table) : false,
'show_aging_table' => $this->has('show_aging_table') ? \boolval($this->show_aging_table) : false,
]);
}
public function client(): Client
{
2021-12-17 01:40:44 +01:00
// return Client::withTrashed()->without('contacts.company', 'documents', 'gateway_tokens')->where('id', auth('contact')->user()->client_id)->first();
return auth('contact')->user()->client;
2021-09-15 17:23:07 +02:00
}
}