1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 23:22:52 +01:00
invoiceninja/app/Http/Requests/UpdateDocumentRequest.php
2019-01-30 22:25:07 +11:00

38 lines
692 B
PHP

<?php
namespace App\Http\Requests;
use App\Models\Contact;
class UpdateDocumentRequest extends DocumentRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
$contact = Contact::getContactIfLoggedIn();
if($contact && $contact->account->hasFeature(FEATURE_DOCUMENTS))
return true;
else
return $this->entity() && $this->user()->can('edit', $this->entity());
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
];
}
}