DALT.PHP
Introduction

Quick Start

Install DALT and build your first route in 5 minutes

Get DALT running in 5 minutes. You'll install it, start the server, and create your first route.

Prerequisites

You need PHP 8.2+ and Composer installed.

Check your versions:

php --version    # Should be 8.2 or higher
composer --version

Installation

Create Project

composer create-project ibnuafdel/daltphp my-app "^0.3" --stability=beta --remove-vcs

This downloads DALT and creates a new project in the my-app directory.

Install Dependencies

composer install

This installs the PHP packages. (Note: DALT's built-in frontend is pre-compiled. If you plan to customize the Tailwind CSS later, you can optionally run npm install).

Setup Database

cp .env.example .env
php artisan migrate

This creates your environment file and sets up the database. DALT uses SQLite by default, so no configuration needed.

Start the Server

php artisan serve

This starts the local PHP development server.

Modifying the frontend later?
DALT's welcome page and dashboard ship with pre-built assets, so you don't need Node.js just to get started! If you decide to write custom Tailwind CSS or Vue components later, you can optionally run npm run dev in a separate terminal.

Open in Browser

Visit http://localhost:8000

You should see the DALT welcome page.

You're running! DALT is installed and working.

Your First Route

Let's create a simple route to see how DALT works.

Open routes/routes.php and add this at the bottom:

$router->get('/hello', function() {
    echo "Hello from DALT!";
});

Visit http://localhost:8000/hello and you'll see your message.

That's it. You defined a route and it works. No caching, no configuration, no magic.

Your First Controller

Routes can also point to controller files. Create a new file at app/Http/controllers/hello.php:

<?php

echo "Hello from a controller!";

Now update your route in routes/routes.php:

$router->get('/hello', 'hello.php');

Visit http://localhost:8000/hello again. Same result, but now the logic is in a separate file.

Your First Database Query

Let's query the database. Update app/Http/controllers/hello.php:

<?php

use Core\App;
use Core\Database;

$db = App::resolve(Database::class);

$users = $db->query('SELECT * FROM users')->get();

echo "Found " . count($users) . " users";

Visit http://localhost:8000/hello and you'll see how many users exist (probably 0 right now).

Next Steps

You now have DALT running and understand the basics. Here's what to explore next:

Build something real: Follow the Building a Blog guide to create a complete application from scratch.

Learn the concepts: Check out the sidebar for guides on routing, database, authentication, and more.

Try the challenges: If you want structured practice, explore the Lessons and Challenges sections in the sidebar.

Common Issues

Port already in use?

php artisan serve --port=8001

Database errors?

php artisan migrate:fresh

Permission errors?

chmod -R 775 storage database

On this page