Your IP : 216.73.216.91


Current Path : /var/www/html/LLCF-APP/app/Http/Requests/
Upload File :
Current File : /var/www/html/LLCF-APP/app/Http/Requests/UpdateCompanyRequest.php

<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class UpdateCompanyRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        $id = $this->route('id');

        return [
            'companyName' => 'required|string|max:255',

            'companyAddress' => [
                'nullable',
                'string',
                'max:500',
                Rule::unique('company', 'companyAddress')->ignore($id, 'idCompany')
            ],

            'companyPhone' => [
                'nullable',
                'string',
                'max:20',
                Rule::unique('company', 'companyPhone')->ignore($id, 'idCompany')
            ],

            'timeStamp' => 'nullable|date',
            'idUser' => 'nullable|integer',
            'isActive' => 'nullable|boolean',
            'idBillTitle' => 'nullable|integer',
            'unitPrice' => 'nullable|numeric|min:0',
            'idCurrency' => 'nullable|integer',
            'tSign' => 'nullable|string|max:255',
            'rSign' => 'nullable|string|max:255',
            'vat' => 'nullable|numeric|min:0',
            'smCharges' => 'nullable|numeric|min:0',
        ];
    }
}