Ecommerce
Validation

Introduction

We are provides several different approaches to validate your application's incoming data. It is most common to use the validate method available on all incoming HTTP requests. However, we will discuss other approaches to validation as well.

Our API is includes a wide variety of convenient validation rules that you may apply to data, even providing the ability to validate if values are unique in a given database table. We'll cover each of these validation rules in detail so that you are familiar with all of Laravel's validation features.

Create a user

Suppose you want to create a user so how you will get validated data from user.

Our Validation roles is very simple

"validation": {
    "roles": {
        "name": "required",
        "unique" : {
            "email" : "unique",
            ...
        },
        
        "extend_props":{
            "check": "required",
            ...
        }
    }
}

Example here

https://ecom.coderorbit.com/public/api/register
 
headers:{ 
    "Accept": "application/json",
    "App-Master-Key": `${app_token}`
}
 
 
body: {
 
    "name": "", // required
    "email": "", // required
    "password": "", // required
    "password_confirmation": "", // required
    "country_id": "", // required
    "extend_props": {
        "other_info_1": "other value one",
        "other_info_2": "other value two",
        .....
    },
  
    "validation": {
        "roles": {
            "name": "required",
            "unique" : {
                "email" : "unique",
                ...
            },
            
            "extend_props":{
                "check": "required",
                ...
            }
        }
    }
    
}

You can check here more deatils Check here (opens in a new tab)

CODER ORBIT
Bangladesh Office:
Call: 01534-645492
11/C, House-01, Lane-10
Road-11, Dhaka 1216
Email: support@coderorbit.com
Others
Domain & Hosting
Course
Debug
Portfolio
FOLLOW US
SUBSCRIBE US
Subscribe
2018 - 2024 Copyright © Coder Orbit. All rights reserved.