PHP code example of quikapi / framework

1. Go to this page and download the library: Download quikapi/framework 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/ */

    

quikapi / framework example snippets


use QuikAPI\Controllers\HealthController;

$router->get('/health', [HealthController::class, 'index']);

namespace QuikAPI\Controllers;

use QuikAPI\Http\Request;

class UserController {
    public function index(Request $req): array { return ['items' => []]; }
    public function show(Request $req): array { return ['id' => $req->params['id'] ?? null]; }
}

$hash = Password::hash($plain);
$ok = Password::verify($plain, $hash);
bash
php -S 127.0.0.1:8082 QuikAPI/server.php
bash
php quikapi make:controller User
php quikapi make:model User
php quikapi make:module Post

QuikAPI/
  Controllers/
  Database/
  Http/
  Middleware/
  Security/
  routes.php
  index.php
  server.php
  cli.php