Commit 92caabe5 by 杨树贤

更新用户必填

parent 5691d711
Showing with 7 additions and 2 deletions
......@@ -2,6 +2,7 @@
namespace App\Http\Requests;
use App\Models\UserModel;
use Illuminate\Foundation\Http\FormRequest;
class UserUpdate extends BaseRequest
......@@ -23,11 +24,15 @@ class UserUpdate extends BaseRequest
*/
public function rules()
{
return [
$rule = [
'account_properties' => 'required|in:1,2',
'company_name' => 'required|max:50',
'first_name' => 'required|max:50',
'last_name' => 'required|max:50',
];
if (request()->input('account_properties') == UserModel::ACCOUNT_PROPERTIES_COMPANY) {
$rule['company_name'] = 'required|max:50';
}
return $rule;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment