PHPackages                             kernelk14/aura - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. kernelk14/aura

ActiveProject[Framework](/categories/framework)

kernelk14/aura
==============

AuraPHP - Lightweight PHP MVC Framework with OwnStrap CSS

v1.0.13(1w ago)111↓100%MITPHPPHP &gt;=7.4

Since May 29Pushed 1w agoCompare

[ Source](https://github.com/kernelk14/aura)[ Packagist](https://packagist.org/packages/kernelk14/aura)[ RSS](/packages/kernelk14-aura/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (14)Used By (0)

AuraPHP
=======

[](#auraphp)

 [![PHP 7.4+](https://camo.githubusercontent.com/e7ea831a492b4b91e05a9c1a6de462568055a9ef79ac038237fdd7dfdc4ac025/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d3737374242343f6c6f676f3d706870)](https://camo.githubusercontent.com/e7ea831a492b4b91e05a9c1a6de462568055a9ef79ac038237fdd7dfdc4ac025/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d3737374242343f6c6f676f3d706870) [![Version 1.0](https://camo.githubusercontent.com/ac0e6350bd1a747fd6c3ffa64781612d3997df0c837a082a30d7af82a79ee225/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302d626c7565)](https://camo.githubusercontent.com/ac0e6350bd1a747fd6c3ffa64781612d3997df0c837a082a30d7af82a79ee225/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302d626c7565) [![Size ~150KB](https://camo.githubusercontent.com/9185c5cdd4adf6e9ab641d78f73a3affb8bf90071be4d6372c70c52c5825a5b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73697a652d7e3135304b422d677265656e)](https://camo.githubusercontent.com/9185c5cdd4adf6e9ab641d78f73a3affb8bf90071be4d6372c70c52c5825a5b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73697a652d7e3135304b422d677265656e) [![MIT License](https://camo.githubusercontent.com/3921b6a636b7d3fc4db90f929b9047fb47fa4fdd6233a2b5fa60b827480fc2c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d79656c6c6f77)](https://camo.githubusercontent.com/3921b6a636b7d3fc4db90f929b9047fb47fa4fdd6233a2b5fa60b827480fc2c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d79656c6c6f77)

**AuraPHP** is a lightweight PHP MVC framework designed for rapid web application development. It ships with **OwnStrap**, a custom CSS/JS framework providing 300+ utility classes and 10+ interactive components — no external dependencies required.

- **Size**: ~150KB total (framework + CSS + JS + fonts)
- **PHP**: 7.4+
- **License**: MIT

---

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [The `aura` CLI Tool](#the-aura-cli-tool)
- [Project Structure](#project-structure)
- [Routing](#routing)
- [Controllers](#controllers)
- [Views](#views)
- [Models](#models)
- [Migrations](#migrations)
- [Middleware](#middleware)
- [Events &amp; Listeners](#events--listeners)
- [Form Requests &amp; Validation](#form-requests--validation)
- [Database](#database)
- [OwnStrap CSS Framework](#ownstrap-css-framework)
- [Accessibility](#accessibility)
- [Server Configuration](#server-configuration)
- [Configuration Reference](#configuration-reference)
- [Environment File](#environment-file)
- [License](#license)

---

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer create-project kernelk14/aura my-app
cd my-app
php aura serve
```

### Manual

[](#manual)

Clone the repository and point your web server to the project root:

```
git clone https://github.com/kernelk14/aura.git
cd auraphp
php aura serve
```

### Requirements

[](#requirements)

RequirementVersionPHP&gt;= 7.4Web ServerApache (mod\_rewrite), Nginx, or PHP built-inDatabase (optional)MySQL, PostgreSQL, or SQLiteComposer (optional)For dependency management---

Quick Start
-----------

[](#quick-start)

### 1. Start the dev server

[](#1-start-the-dev-server)

```
php aura serve
# Opens at http://127.0.0.1:8080
```

### 2. Configure

[](#2-configure)

Edit `system/config/config.php`:

```
return [
    'base_url' => 'http://localhost:8080',
];
```

### 3. Define a route

[](#3-define-a-route)

```
// system/config/routes.php
$router->get('hello', 'hello@index');
```

### 4. Create a controller

[](#4-create-a-controller)

```
// site/controllers/hello.php
namespace SiteControllers;

use AuraCore\Controller;

class Hello extends Controller
{
    public function index()
    {
        $this->loadView('hello', [
            'title' => 'Hello World',
        ]);
    }
}
```

### 5. Create a view

[](#5-create-a-view)

```

    Welcome to AuraPHP.

```

Views are pure content — no HTML shell needed. The template layout (`DOCTYPE`, ``, ``, ``, navbar, JS) wraps around your view automatically.

---

The `aura` CLI Tool
-------------------

[](#the-aura-cli-tool)

AuraPHP includes a powerful command-line tool inspired by Laravel Artisan and Spiral Spark.

```
php aura list
```

### Server &amp; Dev

[](#server--dev)

CommandDescription`php aura serve`Start the PHP development server`php aura serve --port=3000 --host=0.0.0.0`Start on custom host/port### Generators

[](#generators)

CommandDescription`php aura make:controller `Generate a controller`php aura make:controller  --resource`Generate a resource controller (7 REST methods)`php aura make:model `Generate a model`php aura make:migration `Generate a migration`php aura make:seeder `Generate a database seeder`php aura make:view `Generate a view`php aura make:middleware `Generate middleware`php aura make:event `Generate an event class`php aura make:listener `Generate an event listener`php aura make:request `Generate a form request / validation class`php aura make:rule `Generate a custom validation rule`php aura make:scope `Generate a model global scope`php aura make:helper `Generate a helper file`php aura make:command `Generate a custom CLI command`php aura make:provider `Generate a service providerAll generators accept `--force` to overwrite existing files.

### Database

[](#database)

CommandDescription`php aura migrate`Run all pending migrations`php aura migrate:rollback`Rollback the last migration batch`php aura migrate:status`Show migration status`php aura migrate:fresh`Drop all tables and re-run all migrations`php aura migrate:reset`Rollback all migrations`php aura migrate:refresh`Rollback all and re-run all migrations`php aura db:seed`Run all database seeders`php aura db:seed --class=UserSeeder`Run a specific seeder`php aura db:wipe`Drop all tables### Utilities

[](#utilities)

CommandDescription`php aura route:list`Display all registered routes`php aura key:generate`Generate an application encryption key`php aura about`Show framework information and application stats`php aura inspire`Show an inspiring quote`php aura list`List all available commands### Examples

[](#examples)

```
# Start development server on custom port
php aura serve --port=3000 --host=0.0.0.0

# Generate a resource controller with 7 REST methods
php aura make:controller Product --resource

# Generate a model with CRUD methods
php aura make:model User

# List all routes with methods and handlers
php aura route:list

# Run a specific seeder
php aura db:seed --class=UserSeeder

# Show framework info
php aura about

# See framework version
php aura --version
```

---

Project Structure
-----------------

[](#project-structure)

```
my-app/
├── aura                         # CLI tool
├── public/
│   ├── css/
│   │   └── ownstrap.css         # Main CSS framework (~2609 lines)
│   ├── js/
│   │   └── ownstrap.js          # JavaScript library (~1154 lines)
│   └── fonts/                   # Inter & Fira Sans fonts
├── site/
│   ├── controllers/             # Application controllers
│   ├── models/                  # Application models
│   ├── templates/               # Reusable template partials
│   │   ├── sidebar-framework.php
│   │   └── sidebar-ownstrap.php
│   └── views/                   # Application views
├── system/
│   ├── core/
│   │   ├── base.php             # Base class
│   │   ├── content-wrapper.php    # Base HTML layout
│   │   ├── controller.php       # Base controller
│   │   ├── model.php            # Base model
│   │   ├── router.php           # Router
│   │   └── database.php         # Database + QueryBuilder
│   ├── config/
│   │   ├── config.php           # Application config
│   │   ├── database.php         # Database connection config
│   │   └── routes.php           # Route definitions
│   └── helpers/
│       └── url_helper.php       # Global helper functions
├── vendor/                      # Composer dependencies
├── composer.json
├── index.php                    # Entry point
├── .htaccess                    # Apache rewrite rules
└── .env                         # Environment variables

```

---

Routing
-------

[](#routing)

Routes are defined in `system/config/routes.php`. The router supports GET, POST, PUT, DELETE, and wildcard (`any`) methods.

### Basic routes

[](#basic-routes)

```
$router->get('/', 'welcome@index');
$router->get('about', 'page@about');
$router->post('contact', 'contact@store');
$router->put('users/:id', 'user@update');
$router->delete('users/:id', 'user@destroy');
$router->any('webhook', 'webhook@handle');
```

### Route parameters

[](#route-parameters)

Use `:param` syntax. Parameters are passed as positional arguments to the controller method:

```
// Route
$router->get('blog/:id/:slug', 'blog@show');

// Controller method receives $id and $slug
class Blog extends Controller {
    public function show($id, $slug) {
        echo "Post #{$id}: {$slug}";
    }
}
```

### Callback handlers

[](#callback-handlers)

You can also use closures directly:

```
$router->get('api/time', function() {
    echo json_encode(['time' => date('Y-m-d H:i:s')]);
});
```

### Route listing

[](#route-listing)

```
php aura route:list
```

Output:

```
Method  Path                                    Handler
────────────────────────────────────────────────────────────────────────────────
GET     /                                       welcome@index
GET     /welcome                                welcome@index
GET     /components                             components@index
GET     /demo/user/:id                          demo@user

```

---

Controllers
-----------

[](#controllers)

Controllers live in `site/controllers/` and extend `AuraCore\Controller`.

### Naming conventions

[](#naming-conventions)

ItemConventionExampleFile nameLowercase kebab`user-profile.php`Class namePascalCase`UserProfile`Namespace`SiteControllers``SiteControllers\UserProfile`Route handler`file@method``user-profile@index`### Example controller

[](#example-controller)

```

```

The layout provides the DOCTYPE, ``, `` (with `ownstrap_css()`), `` with navbar, and `ownstrap_js()` before the closing `` tag. Your view only needs the middle content.

To skip the layout (e.g. for standalone pages), pass `false` as the third argument:

```
$this->loadView('welcome', $data, false);
```

### Passing data

[](#passing-data)

Controllers pass data as an associative array:

```
// Controller
$this->loadView('user-profile', [
    'title' => 'User Profile',
    'user' => ['name' => 'Alice', 'email' => 'alice@example.com'],
]);
```

The view receives `$title` and `$user` as variables:

```
