PHP code example of footup / framework

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

    

footup / framework example snippets


$app->routes(function () {
    Route::get('/', [HomeController::class, 'index']);
    Route::get('/welcome', [WelcomeController::class, 'index']);
});

use Footup\Facades\Route;

Route::get('/hello/{name}', function ($request, $name) {
    return json(['hello' => $name]);
});

final class HomeController extends Controller
{
    public function index(): Response
    {
        return view('home', ['name' => 'Footup']);
    }
}

use Footup\DB;

DB::table('users')->where('name', 'like', '%Ada%')->get();
DB::table('users')->insert(['name' => 'Grace Hopper']);

final class User extends \Core\Model
{
    protected static string $table = 'users';
}

User::all();
User::find(1);
$user = (new User(['name' => 'Grace Hopper']))->save();

logger('User logged in', ['id' => $user->id]);
bash
cp .env.example .env
composer install
php bin/console.php migrate
php bin/console.php serve
bash
php bin/console.php migrate
bash
php bin/console.php migrate
bash
php bin/console.php bench /welcome 100
bash
php bin/console.php serve
php bin/console.php migrate
php bin/console.php route:list
php bin/console.php bench /welcome 100