PHPackages                             inspira/application - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. inspira/application

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

inspira/application
===================

The Inspira application setup

018CSS

Since May 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nadlambino/inspira-app)[ Packagist](https://packagist.org/packages/inspira/application)[ RSS](/packages/inspira-application/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🔥Inspira Framework
==================

[](#inspira-framework)

A simple PHP MVC framework inspired from Laravel.

### DISCLAIMER !!!

[](#disclaimer-)

This project is for fun and educational purposes only.

---

### How to use?

[](#how-to-use)

#### Create a project via composer.

[](#create-a-project-via-composer)

```
composer create-project inspira/application -s dev

```

Note:

- You can change the project name to your desired name

#### Start the application.

[](#start-the-application)

```
php wizard run

```

Note:

- You can set a custom port by providing the `port` option in the command
- You can also set a custom host by providing the `host` option in the command. Just make sure that this host is added in your host file.
- To see all available commands, run `php wizard`.

---

### Features

[](#features)

#### ⭐Router

[](#router)

You can register your web routes at `routes.php` located in `app` directory.

Router's supported methods are `get`, `post`, `put`, and `delete`.

The parameters are as follows:

##### Uri

[](#uri)

- string
- required

##### Handler

[](#handler)

- array | Closure
- required
- The shape of array handler should be \[controller, method\]

##### Middlewares

[](#middlewares)

- array | string
- optional
- Default is empty array

##### Name

[](#name)

- string
- optional

```

use App\Controllers\HomeController;

/** @var Inspira\Http\Router\Router $router */
$router->get('/user/:id/posts/:post?', [HomeController::class, 'index'], \App\Middlewares\AuthMiddleware::class, 'home');

```

Router also supports dynamic route parameters, both required and optional.

To indicate a route parameter, just prefix it with a colon `:`, and to indicate an optional route parameter, just suffix it with a question mark `?`.

You can access these parameters from the request object via property access or get method. For example, you register the following route `/users/:id/posts/:post?`

```

use Inspira\Http\Request;

class HomeController
{
	public function index(Request $request)
	{
		echo $request->id;
		// post is optional and might be null so you can use get() and provide a default value
		echo $request->get('post', 1);
	}
}

```

---

#### ⭐Middlewares

[](#middlewares-1)

You can create your own middlewares inside of `app/Middlewares` directory. The middleware should extend the `Middleware` abstract class as it implements PSR's MiddlewareInterface.

After creating your middleware, you can modify the boolean `$global` property to indicate whether this middleware should run on all requests. If you wish to only run the middleware on specific route, then you should set `$global` to `false` and attach the middleware from route registration.

```

namespace App\Middlewares;

use Inspira\Http\Middlewares\Middleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

class AuthMiddleware extends Middleware
{
	// Change the value based on your needs
	public bool $global = false;

	public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
	{
		// Do something with the request object and pass to the next handler or immediately return a response
		return $handler->handle($request);
	}
}

```

---

#### ⭐Service Container

[](#service-container)

Service Container is the heart of this framework. It handles the dependency injection and automatically resolve these dependencies through the use of PHP's Reflection API.

Service Container can be used to

- Bind a concrete class to an abstract class
- Bind a singleton class
- Make an instance of a class with deep dependency

Currently, container can only resolve injected dependencies that are a valid class, enum, or interface. However, you can still bind an implementation to any word you want and use the `make` method to resolve it.

```

// Example of binding
container()->bind(StorageInterface::class, LocalStorage::class);

// In controller method
public function upload(StorageInterface $storage) {
    print_f($storage instanceof LocalStorage::class); // prints out true
}

// Example of singleton binding
// You will get only one instance of Database class throughout the request
container()->singleton(DatabaseInterface::class, Database::class); // or container()->singleton(Database::class) if you don't need to bind it to an interface

// In controller method
public function create(Database $database) {
    $database->table(...); // you will get the same instance throughout the request
}

// Example of making an instance
// Let's say that request class has a lot of dependencies, and it's dependencies also have dependencies
// Service Container will do all the work for you to make an instance of it
container()->make(Request::class); // or container()->make('auth') if for example you bound an Auth class to the word `auth`

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2b2938add7fe0c000deb7f15e9259c27039409e918783b4a7cf2b9b4e3f35d0?d=identicon)[nadlambino](/maintainers/nadlambino)

---

Top Contributors

[![nadlambino](https://avatars.githubusercontent.com/u/50892397?v=4)](https://github.com/nadlambino "nadlambino (57 commits)")

### Embed Badge

![Health badge](/badges/inspira-application/health.svg)

```
[![Health](https://phpackages.com/badges/inspira-application/health.svg)](https://phpackages.com/packages/inspira-application)
```

###  Alternatives

[htmlburger/carbon-fields-plugin

WordPress plugin loader for Carbon Fields.

1750.5k2](/packages/htmlburger-carbon-fields-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
