PHP code example of oktorino / midresapi

1. Go to this page and download the library: Download oktorino/midresapi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oktorino / midresapi example snippets


'midresapi' => \Oktorino\Midresapi\ConsistencyStructure::class;

Route::get('/', function(){
    return response("response work !!!");
})->middleware("midresapi");

  return "successs";
  #or
  return response("success");
 

  $user=\App\User::first();
  return response($user);
 

  $users=\App\User::limit(2)->get();
  return response($users);
 

  return response("can't be proccess");
json
 {
    "status_code": 500,
    "success": false,
    "message": "Something went wrong !!!",
    "data": null,
    "errors": [
        {
            "message": "Undefined variable: undefine_var",
            "file": "/home/tuah/apps/consistency_response/routes/api.php",
            "line": 24
        }
    ]
}