PHPackages                             strukt/framework - 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. strukt/framework

ActiveLibrary[Framework](/categories/framework)

strukt/framework
================

Strukt Framework

v1.1.8-alpha(1y ago)09252MITPHPPHP ^8.1

Since Jan 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/struktapp/strukt-framework)[ Packagist](https://packagist.org/packages/strukt/framework)[ RSS](/packages/strukt-framework/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (13)Used By (2)

Strukt Framework
================

[](#strukt-framework)

[![Build Status](https://camo.githubusercontent.com/b1624766d77e5595ce27c3d880520ee80ba6ae7569693ef68b7c5cbac7d3a78d/68747470733a2f2f7472617669732d63692e6f72672f73616d776572752f737472756b742d6672616d65776f726b2e7376673f6272616e63683d6d6173746572)](https://packagist.org/packages/strukt/framework)[![Latest Stable Version](https://camo.githubusercontent.com/695a70fec85042ea1d20e905b41dc8fe3a2e4e0b12cd388d4b6244f3feac3451/68747470733a2f2f706f7365722e707567782e6f72672f737472756b742f6672616d65776f726b2f762f737461626c65)](https://packagist.org/packages/strukt/framework)[![Total Downloads](https://camo.githubusercontent.com/28693677b806c22ec98b42d91961787abc3eb47149492c70afb25d1bf5914aee/68747470733a2f2f706f7365722e707567782e6f72672f737472756b742f6672616d65776f726b2f646f776e6c6f616473)](https://packagist.org/packages/strukt/framework)[![Latest Unstable Version](https://camo.githubusercontent.com/ba4a00478c75aa91421f6be5949e44bf139c7623598a362b02210aa8a84efdf7/68747470733a2f2f706f7365722e707567782e6f72672f737472756b742f6672616d65776f726b2f762f756e737461626c65)](https://packagist.org/packages/strukt/framework)[![License](https://camo.githubusercontent.com/69776e5e99c6241a72e3bb68c8818ae47a08d2ca67d17c8e2e260e35babfb6a0/68747470733a2f2f706f7365722e707567782e6f72672f737472756b742f6672616d65776f726b2f6c6963656e7365)](https://packagist.org/packages/strukt/framework)

The is the package that unifies all [strukt-strukt](https://github.com/samweru/strukt-strukt)components under the framework.

Rarely should anyone use this on its own.

### Getting started

[](#getting-started)

```
echo {"minimum-stability":"dev"} > composer.json
composer require "strukt/framework:1.1.8-alpha" --prefer-dist
```

Setup, Cache, Configuration &amp; Environment
---------------------------------------------

[](#setup-cache-configuration--environment)

### Cache

[](#cache)

Always remember to clear and reload the cache when necessary

```
./xcli cache:clear
./xcli cache:make
```

### Shell

[](#shell)

Drop into shell

```
./xcli shell:exec
```

### Setting Application Type

[](#setting-application-type)

```
config("app.type", "App:Idx")// for index.php, alternative App:Cli for console
```

### Configuration

[](#configuration)

```
config("facet.middlewares")
config("facet.providers")
```

### Environment Setup

[](#environment-setup)

This class is defaultly found in [strukt-commons](https://github.com/samweru/strukt-commons)

```
Strukt\Env::withFile();//default .env file in your root folder
Strukt\Env::withFile(".env-dev");
env("root_dir", getcwd());//setter custom environment variable
env("root_dir");//getter
```

### Setup Packages Registry

[](#setup-packages-registry)

Packages reference file location `./cfg/repo.ini`

```
repos(); //list all repositories
repos("published");//list all published strukt packages
repos("installed");//list all installed strukt packages
```

Packages
--------

[](#packages)

### Default Package

[](#default-package)

```
package("core", "App:Idx")->get("settings"); //returns array of middlewares, commands and providers
//below mode:App:Cli is default
package("core")->get("name");//core
package("core")->get("cmd:name");//null
package("core")->get("files");//null
package("core")->get("modules");//null
package("core")->get("is:published");//true by default
package("core")->get("requirements");//null or array
```

The above methods are interfaced in class `Strukt\Framework\Contract\Package` you must use them in your package.

### Building Packages

[](#building-packages)

The first step in developing your package will require you to install `strukt-framework`and execute `composer exec strukt` command that will create your folder structure. You'll need to create `src` and `package` folders.

See structure of package below:

```
├── bootstrap.php
├── cfg/
├── console
├── index.php
├── lib/
├── tpl/
├── vendor/
├── composer.json
├── LICENSE
├── package/ #Place all your packages files here
├── README.md
└── src
    └── Strukt
        └── Package
            └── Pkg{{Package Name}}.php #Identify your package resources here
```

Again, your package class in `src/Strukt/Package/Pkg.php` will have methods listed in `Strukt\Fraamework\Contract\Package`

### Package Autoloading

[](#package-autoloading)

You may require to autoload libraries both from your root directory and package resources.

```
$loader = require "vendor/autoload.php";
...
...
$loader->addPsr4("App\\", [

	__DIR__."/lib/App",
	__DIR__."/package/lib/App"
]);

return $loader;
```

### Note

[](#note)

For packages that require installation into your `app/src/{{AppName}}` folder, there are a few tricks you could use while building your package. The `publish:package` command takes argument `` for publishing packages that are currently in development, since your source will be in the root folder in a subfolder called `package`.

This will require you to enter into your `cfg/repo.php` and indicate you are currently in-development with the key/keyword `package` which will allow the publisher to install files in the your app source folder `app/src`.

The `publish:package` command installs from `vendor` but in development-mode you can use `--dev` switch to install your package that will be located in your project root.

Validator
---------

[](#validator)

### Example

[](#example)

```
namespace Payroll\AuthModule\Form;

use Strukt\Framework\Contract\Form as AbstractForm;

class User extends AbstractForm{

	/**
	* @IsNotEmpty()
	* @IsAlpha()
	*/
	public string $username;

	/**
	* @IsNotEmpty()
	*/
	public string $password;
}
```

### Validator Annotations

[](#validator-annotations)

```
/**
* @IsNotEmpty()
* @IsAlpha()
* @IsAlphaNum()
* @IsNumeric()
* @IsEmail()
* @IsDate(Y-m-d)
* @IsIn(a,b,c)
* @EqualTo(xyz)
* @IsLen(10)
*/
```

### Adding Validators

[](#adding-validators)

New validators can be added is in your `lib/App/Validator.php`There you can find an example `App\Validator::isLenGt`

```
/**
* @IsLenGt(10)
*/
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance48

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99% 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.

###  Release Activity

Cadence

Every ~121 days

Recently: every ~206 days

Total

11

Last Release

381d ago

PHP version history (2 changes)v1.0.0-alphaPHP ^7.1.3

v1.1.7-alphaPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f77a56030c77ce25f7fcf6db800e45bb6a31bf3c07740b43aeabcdf5e9edec2?d=identicon)[pitsolu](/maintainers/pitsolu)

---

Top Contributors

[![pitsolu](https://avatars.githubusercontent.com/u/16669704?v=4)](https://github.com/pitsolu "pitsolu (509 commits)")[![samweru](https://avatars.githubusercontent.com/u/104033121?v=4)](https://github.com/samweru "samweru (5 commits)")

### Embed Badge

![Health badge](/badges/strukt-framework/health.svg)

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

###  Alternatives

[laravel/tinker

Powerful REPL for the Laravel framework.

7.4k423.8M1.8k](/packages/laravel-tinker)[pestphp/pest

The elegant PHP Testing Framework.

11.5k59.5M14.2k](/packages/pestphp-pest)[getkirby/cms

The Kirby core

1.5k535.5k352](/packages/getkirby-cms)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[bowphp/framework

The bow PHP Framework

6015.5k8](/packages/bowphp-framework)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)

PHPackages © 2026

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