1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Http/Requests/CreatePaymentTermAPIRequest.php
David Bomba 9d1cb37835
Payment Terms via API (#1808)
Added the ability to get payment_terms, payment_term and create a new payment_term via the API.
2018-01-14 23:21:10 +11:00

37 lines
603 B
PHP

<?php
namespace App\Http\Requests;
use App\Models\Invoice;
class CreatePaymentTermAPIRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return $this->user()->can('create', ENTITY_PAYMENT_TERM);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rules = [
'num_days' => 'required|numeric|unique:payment_terms',
];
return $rules;
}
}