芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Http/Requests/Admin/Client/UpdateClientRequest.php
<?php namespace App\Http\Requests\Admin\Client; use App\Http\Requests\CoreRequest; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class UpdateClientRequest extends CoreRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'email' => 'nullable|email|required_if:login,enable|unique:users,email,'.$this->route('client').',id,company_id,' . company()->id, 'slack_username' => 'nullable|unique', 'name' => 'required', 'website' => 'nullable|url', 'country' => 'required_with:mobile', 'password' => 'nullable|min:8', 'mobile' => 'nullable|numeric' ]; if (request()->get('custom_fields_data')) { $fields = request()->get('custom_fields_data'); foreach ($fields as $key => $value) { $idarray = explode('_', $key); $id = end($idarray); $customField = \App\Models\CustomField::findOrFail($id); if ($customField->required == 'yes' && (is_null($value) || $value == '')) { $rules['custom_fields_data['.$key.']'] = 'required'; } } } return $rules; } public function attributes() { $attributes = []; if (request()->get('custom_fields_data')) { $fields = request()->get('custom_fields_data'); foreach ($fields as $key => $value) { $idarray = explode('_', $key); $id = end($idarray); $customField = \App\Models\CustomField::findOrFail($id); if ($customField->required == 'yes') { $attributes['custom_fields_data['.$key.']'] = $customField->label; } } } return $attributes; } }
Error 404 (Not Found)
404
Page not found.
Back To Home