PHPackages                             jupitern/slim3-skeleton - 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. [CLI &amp; Console](/categories/cli)
4. /
5. jupitern/slim3-skeleton

ActiveLibrary[CLI &amp; Console](/categories/cli)

jupitern/slim3-skeleton
=======================

Slim starter / Slim skeleton package to boost your development with Slim framework

3.1.0(5y ago)4432512[2 issues](https://github.com/jupitern/slim3-skeleton/issues)[2 PRs](https://github.com/jupitern/slim3-skeleton/pulls)MITPHPPHP &gt;= 7.0

Since Dec 12Pushed 5y ago6 watchersCompare

[ Source](https://github.com/jupitern/slim3-skeleton)[ Packagist](https://packagist.org/packages/jupitern/slim3-skeleton)[ RSS](/packages/jupitern-slim3-skeleton/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (5)Versions (44)Used By (0)

Slim Framework 3 Skeleton Application (http + cli)
==================================================

[](#slim-framework-3-skeleton-application-http--cli)

Use this skeleton application to quickly setup and start working on a new Slim Framework 3 application (Tested with slim 3.12). This application handles http and command line requests. This application ships with a few service providers and a session middleware out of the box. Support for container resolution and auto-wiring.

To remove a service provider comment it on config/app.php file and remove it from composer.json, update composer.

Available service providers:

- [SlashTrace](https://github.com/slashtrace/slashtrace)
- [Monolog](https://github.com/Seldaek/monolog)
- [Eloquent](https://github.com/illuminate/database)
- [Plates](https://github.com/thephpleague/plates)
- [Twig](https://github.com/twigphp/Twig)
- [Flysystem](https://github.com/thephpleague/flysystem)
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
- [Redis](https://github.com/predis/predis)

Available middleware:

- Session

### Install the Application

[](#install-the-application)

Run this command from the directory in which you want to install your new Slim Framework application.

```
php composer.phar create-project jupitern/slim3-skeleton [my-app-name]

```

Replace `[my-app-name]` with the desired directory name for your new application. You'll want to:

- Point your virtual host document root to your new application's `public/` directory.
- Ensure `storage/` is web writable.
- make the necessary changes in config file config/app.php

### Run it:

[](#run-it)

1. `$ cd [my-app-name]\public`
2. `$ php -S localhost:8080` OR `$ composer serve`
3. Browse to

### Key directories

[](#key-directories)

- `app`: Application code (models, controllers, cli commands, handlers, middleware, service providers and others)
- `config`: Configuration files like db, mail, routes...
- `lib`: Other project classes like utils, business logic and framework extensions
- `storage`: Log files, cache files and your raw, un-compiled assets such as LESS, SASS, or JavaScript.
- `public`: The public directory contains `index.php` file, assets such as images, JavaScript, and CSS
- `views`: Views template files.
- `vendor`: Composer dependencies

### Routing and dependency injection

[](#routing-and-dependency-injection)

The app class has a route resolver method that:

- matches and injects params into the controller action passed as uri arguments
- looks up and injects dependencies from the container by matching controller constructor / method argument class names
- automatic Resolution using controller constructor / method argument types
- accepts string or Response object as controller action response

Example defining two routes for a website and backend folders:

```
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

// simple route example
$app->get('/welcome/{name}', function (Request $request, Response $response, $args) {
	$name = $request->getAttribute('name');
	$response->getBody()->write("Hello, $name");

	return $response;
});

// example route to resolve request to uri '/' to \App\Http\Site\Welcome::index
$app->any('/', function ($request, $response, $args) use($app) {
	return $app->resolveRoute([\App\Http\Welcome::class, "index"], $args);
});

// example calling http://localhost:8080/index.php/test/nuno with the route bellow
// injects the :name param value into the method $name parameter
// Other parameters in the method will be searched in the container by classname or automatically resolved
// in this example the resolveRoute method will create a user instance and inject it in the controller method
$app->any('/test[/{name}]', function ($request, $response, $args) use($app) {
	return $app->resolveRoute([\App\Http\Welcome::class, "method"], $args);
});

namespace App\Http;
use Jupitern\Slim3\App\Http\Controller;

class Welcome extends Controller
{
	public function method($name, \App\Model\User $user)
	{
	    return get_class($user)."name = {$name}";
	}
}
```

### Console usage

[](#console-usage)

- Usage: php cli.php \[command-name\] \[method-name\] \[parameters...\]
- Help: php cli.php help

How to create a new command:

1. Create a class under directory app\\Console in namespace App\\Console
2. Your class should extend \\App\\Console\\Command
3. create a public method with some params.
4. DONE!

Example:

Command class:

```
namespace App\Console;

class Test extends Command
{

	public function method($a, $b='foobar')
	{
		return
			"\nEntered console command with params: \n".
			"a= {$a}\n".
			"b= {$b}\n";
	}
}
```

Execute the class:method from command line:

```
// since param "b" is optional you can use one of the following commands

> php cli.php Test method a=foo b=bar

> php cli.php Test method a=foo
```

### Code examples

[](#code-examples)

Get application instance

```
$app = \Lib\Framework\App::instance();
// or simpler using a helper function
$app = app();
```

Debug a variable, array or object using the debug helper function

```
debug(['a', 'b', 'c']);
// or debug and exit passing true as second param
debug(['a', 'b', 'c'], true);
```

Read a user from db using Laravel Eloquent service provider

```
$user = \App\Model\User::find(1);
echo $user->Name;
```

Send a email using PHPMailer service provider service named 'mail' on config file

```
/* @var $mail \PHPMailer\PHPMailer\PHPMailer */
$mail = app()->resolve('mail');
$mail->addAddress('john.doe@domain.com');
$mail->Subject = "test";
$mail->Body    = "test body";
$mail->AltBody = "alt body";
$mail->send();
```

List a directory content with Flysystem service provider named 'fs\_local' on config file

```
$filesystem = app()->resolve('fs_local');
$contents = $filesystem->listContents(STORAGE_PATH, true);
var_dump($contents);
```

Write and read from session using Session Helper class

```
// save user info in session
\Jupitern\Slim3\Utils\Session::set('user', ['id' => '1']);
// get user info from session
$uservar = \Jupitern\Slim3\Utils\Session::get('user');
var_dump($uservar);
```

Write and read from cache with Redis service provider named 'redis' on config file

```
/** @var \Jupitern\Slim3\Utils\Redis $cache */
$cache = app()->resolve('redis');
$cache->set("cacheKey", "some test value");
echo $cache->get("cacheKey");
```

Changelog
---------

[](#changelog)

v3.0

- moved core code to another package.
- route resolution using reflection can now be switched off for performance.
- config file services changed structure.
- register services in container using a string instead of classnames.
- code refactor and improvements.

v2.6

- Replaced Whoops and Collision packages by slashtrace that provides http and cli debug

V2.5

- Allow for providers and middleware to be registered only for a given scope (dependent on app name)
- general code improvements and error handling when developing rest api

Roadmap
-------

[](#roadmap)

- more service providers / separate service providers in packages
- more code examples

Contributing
------------

[](#contributing)

- welcome to discuss a bugs, features and ideas.

License
-------

[](#license)

jupitern/slim3-skeleton is release under the MIT license.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~36 days

Recently: every ~187 days

Total

43

Last Release

1960d ago

Major Versions

0.5.0 → 1.0.02017-05-24

1.0.5 → 2.0.02017-11-08

2.6.2 → 3.0.02020-08-26

PHP version history (2 changes)0.1.0PHP &gt;= 5.6.0

2.1.4PHP &gt;= 7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8205aca1dd2a7d1f98452950c3754b7430d16bcfe53494bfdf5c20d277d7776c?d=identicon)[jupitern](/maintainers/jupitern)

---

Top Contributors

[![jupitern](https://avatars.githubusercontent.com/u/4422374?v=4)](https://github.com/jupitern "jupitern (3 commits)")[![jerfeson](https://avatars.githubusercontent.com/u/2961357?v=4)](https://github.com/jerfeson "jerfeson (2 commits)")[![Mario-F](https://avatars.githubusercontent.com/u/16899663?v=4)](https://github.com/Mario-F "Mario-F (2 commits)")

---

Tags

php-frameworkskeleton-applicationslimslim-clislim-frameworkslim3slim3-skeletonapiclislimSkeletonstarterphp frameworkSlim-skeletonslim-phpslim-starter

### Embed Badge

![Health badge](/badges/jupitern-slim3-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/jupitern-slim3-skeleton/health.svg)](https://phpackages.com/packages/jupitern-slim3-skeleton)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[renoki-co/php-helm

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

1310.6k](/packages/renoki-co-php-helm)

PHPackages © 2026

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