2020-09-06 17:06:10 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Portal;
|
|
|
|
|
|
|
|
use App\Abstracts\Http\FormRequest;
|
|
|
|
|
|
|
|
class PaymentShow extends FormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize()
|
|
|
|
{
|
2021-06-30 18:11:49 +03:00
|
|
|
if (auth()->guest()) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Allow admin to see signed invoice
|
2022-06-01 10:15:55 +03:00
|
|
|
if (user()->can('read-banking-transactions')) {
|
2021-06-30 18:11:49 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-09-06 17:06:10 +03:00
|
|
|
return $this->payment->contact_id == user()->contact->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
//
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|