Download the PHP package spark-php/framework without Composer
On this page you can find all versions of the php package spark-php/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spark-php/framework
More information about spark-php/framework
Files in spark-php/framework
Package framework
Short Description Spark — a lightweight, Laravel-inspired PHP framework with routing, ORM, templating, and CLI
License MIT
Homepage https://github.com/pawan1793/spark
Informations about the package framework
Spark
A lightweight, Laravel-inspired PHP framework. No Symfony dependencies, no heavy abstractions — just routing, ORM, templating, middleware, DI, migrations, and a CLI in clean PHP 8.1+ code.
Quick Start
Open http://localhost:8000.
No extra configuration needed — the app key is generated automatically and SQLite is configured out of the box.
Requirements
- PHP 8.1+
- Extensions:
pdo,mbstring,json - No other dependencies
Routing
routes/web.php:
Route params are injected into controller methods by name.
Controllers
Return a Response, an array/object (auto-JSON), or a string (HTML).
Models (ORM)
Relationships: hasOne, hasMany, belongsTo.
Migrations
Supports SQLite, MySQL, and PostgreSQL.
Blade-lite Views (.spark.php)
Templates compile once to plain PHP in storage/cache/views/. Subsequent requests use the cached version.
Directives: @extends @section @endsection @yield @include @if @elseif @else @endif @foreach @endforeach @for @while @isset @empty @unless @php @endphp
Echo: {{ $var }} (HTML-escaped), {!! $html !!} (raw)
Middleware
Built-in: StartSession, VerifyCsrfToken, Cors, ForceHttps.
Service Providers
Register in bootstrap/app.php:
Dependency Injection
Constructor-inject any class; the container resolves dependencies automatically:
CLI
Security defaults
Every response gets these headers automatically:
| Header | Value |
|---|---|
X-Content-Type-Options |
nosniff |
X-Frame-Options |
SAMEORIGIN |
Referrer-Policy |
strict-origin-when-cross-origin |
Content-Security-Policy |
strict + nonce for inline scripts/styles |
Strict-Transport-Security |
set on HTTPS |
Permissions-Policy |
geolocation=(), microphone=(), camera=() |
CSRF tokens, secure session cookies, SQL prepared statements, mass-assignment protection, and open-redirect prevention are all on by default.
Logging
Spark includes a built-in file logger. Logs are written to storage/logs/spark.log.
Log format:
The minimum log level is controlled by LOG_LEVEL in your .env file (default: debug).
Valid levels: debug, info, warning, error.
You can also inject the logger via the container:
Helpers
app(), config(), env(), base_path(), storage_path(), view(), json(), response(), redirect(), abort(), csrf_token(), csrf_field(), bcrypt(), csp_nonce(), e(), dd(), logger()
License
MIT — Copyright (c) 2026 Pawan More
All versions of framework with dependencies
ext-pdo Version *
ext-mbstring Version *
ext-json Version *