mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
63 lines
1.2 KiB
PHP
63 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Http\Requests\Invoice;
|
|
|
|
use App\Http\Requests\Request;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class UpdateInvoiceRequest extends Request
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
|
|
public function authorize() : bool
|
|
{
|
|
|
|
return auth()->user()->can('edit', $this->invoice);
|
|
|
|
}
|
|
|
|
|
|
public function rules()
|
|
{
|
|
|
|
//$this->sanitize();
|
|
|
|
return [
|
|
'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
|
//'client_id' => 'required|integer',
|
|
//'invoice_type_id' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function sanitize()
|
|
{
|
|
$input = $this->all();
|
|
|
|
// $this->replace($input);
|
|
|
|
return $this->all();
|
|
}
|
|
|
|
public function sanitize()
|
|
{
|
|
$input = $this->all();
|
|
|
|
$this->replace($input);
|
|
|
|
return $this->all();
|
|
}
|
|
} |