Validation

PHOTO EMBED

Wed Dec 28 2022 04:15:12 GMT+0000 (Coordinated Universal Time)

Saved by @yugan91 #php #laravel

//Custom Validation 

$validated = Validator::make($data, [
                    'username' => 'required|unique:wbx_pos_merchant_terminals', // note the email field
                    'email' => 'required|unique:wbx_pos_merchant_terminals', // note the email field
                ]);
                return json_encode(
                    [
                        'error' => true,
                        'messages'=>$validated->errors()->all()
                    ]
                );
content_copyCOPY