1. Go to this page and download the library: Download pushinbr/pam-http 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/ */
pushinbr / pam-http example snippets
use Pam\App;
use Pam\Api\RouteConstraint;
$app = new App();
$app->post('/login', [LoginController::class, 'onLogin']);
$app->get('/users/{id}', [UserController::class, 'show'])
->where('id', RouteConstraint::Integer)
->name('users.show');
$app->listen(3000);
use Pam\Api\Database\DatabaseConfig;
use Pam\Api\Database\EloquentServiceProvider;
$app->provider(new EloquentServiceProvider(DatabaseConfig::fromEnvironment()));
final class User extends \Illuminate\Database\Eloquent\Model
{
protected $fillable = ['name', 'email'];
}