PHPackages                             luminearisa/luminous - 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. luminearisa/luminous

ActiveProject[Framework](/categories/framework)

luminearisa/luminous
====================

Luminous - Lightweight PHP Framework for RESTful APIs

v1.0.3(4mo ago)09MITPHPPHP &gt;=8.1

Since Jan 5Pushed 4mo agoCompare

[ Source](https://github.com/luminearisa/luminous)[ Packagist](https://packagist.org/packages/luminearisa/luminous)[ RSS](/packages/luminearisa-luminous/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Luminous Framework
==================

[](#luminous-framework)

**Lightweight PHP Framework for RESTful APIs**

[![PHP Version](https://camo.githubusercontent.com/1a5e13126d38c1d05f712dae30e7f60ae0444a9c882e9e526349ccba27facb8d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e312d626c7565)](https://camo.githubusercontent.com/1a5e13126d38c1d05f712dae30e7f60ae0444a9c882e9e526349ccba27facb8d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344382e312d626c7565)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)

🌟 Features
----------

[](#-features)

- ✅ **PHP Native** - No heavy framework dependencies
- ✅ **MVC Architecture** - Clean separation of concerns
- ✅ **RESTful API** - Built for modern API development
- ✅ **JWT Authentication** - Secure token-based auth
- ✅ **Database Support** - MySQL &amp; SQLite out of the box
- ✅ **CLI Tool** - Powerful `lumi` command-line interface
- ✅ **Shared Hosting Ready** - Deploy to Hostinger, cPanel easily
- ✅ **Clean Configuration** - `.lumi` config system + `.env`

📋 Requirements
--------------

[](#-requirements)

- PHP &gt;= 8.1
- Composer
- MySQL or SQLite

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Installation

[](#1-installation)

```
# Clone or download the framework
cd luminous

# Install dependencies
composer install

# Copy environment file
cp .env.example .env

# Configure your .env file
nano .env
```

### 2. Configuration

[](#2-configuration)

Edit `.env` file:

```
APP_ENV=production
APP_DEBUG=false

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_NAME=your_database
DB_USER=your_username
DB_PASS=your_password

JWT_SECRET=your-super-secret-key-change-this
```

### 3. Make CLI Executable

[](#3-make-cli-executable)

```
chmod +x lumi
```

### 4. Run Development Server

[](#4-run-development-server)

```
php -S localhost:8000
```

Visit:

🛠️ CLI Commands
---------------

[](#️-cli-commands)

Luminous provides a powerful CLI tool called `lumi`:

```
# List all commands
php lumi list

# Create a controller
php lumi make:controller UserController

# Create a model
php lumi make:model User

# Create a migration
php lumi make:migration create_users_table

# Create a middleware
php lumi make:middleware CheckRole

# Run migrations
php lumi migrate
```

📁 Directory Structure
---------------------

[](#-directory-structure)

```
/
├── index.php                 # Entry point (root)
├── lumi                      # CLI tool
├── composer.json             # Dependencies
├── .env                      # Environment config
├── /app
│   ├── /Core                 # Framework core
│   │   ├── Router.php
│   │   ├── Request.php
│   │   ├── Response.php
│   │   ├── Controller.php
│   │   ├── Database.php
│   │   ├── JWT.php
│   │   └── Env.php
│   ├── /Controllers          # Your controllers
│   ├── /Models               # Your models
│   ├── /Middlewares          # Middleware classes
│   ├── /Helpers              # Helper classes
│   └── /Console              # CLI commands
├── /routes
│   └── api.php               # API routes
├── /config
│   └── config.lumi           # Framework config
├── /database
│   └── /migrations           # Database migrations
└── /storage
    ├── /logs                 # Log files
    └── /cache                # Cache files

```

🔧 Configuration System
----------------------

[](#-configuration-system)

Luminous uses two configuration files:

### `.env` - Environment Variables

[](#env---environment-variables)

Used for credentials and environment-specific values:

```
DB_HOST=localhost
DB_NAME=mydb
JWT_SECRET=secret
```

### `config.lumi` - Framework Configuration

[](#configlumi---framework-configuration)

Used for framework settings (JSON format):

```
{
  "jwt": {
    "secret": "env:JWT_SECRET",
    "algo": "HS256",
    "expire": 3600
  }
}
```

Values prefixed with `env:` reference `.env` variables.

🛣️ Routing
----------

[](#️-routing)

Define routes in `routes/api.php`:

```
// Simple route
$router->get('/users', 'UserController@index');

// Route with parameter
$router->get('/users/{id}', 'UserController@show');

// Route with middleware
$router->post('/posts', 'PostController@store', [AuthMiddleware::class]);

// Route group
$router->group(['prefix' => '/api', 'middleware' => AuthMiddleware::class], function ($router) {
    $router->get('/profile', 'UserController@profile');
    $router->put('/profile', 'UserController@update');
});
```

🎮 Controllers
-------------

[](#-controllers)

Create controller using CLI or manually:

```
