Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

slim-born

> 安全
Open source

Slim Framework 3 and 4 skeleton application has authentication MVC construction.

193 stars0 likes0 views
WebsiteGitHub

About

Slim Framework 3 and 4 skeleton application has authentication MVC construction.

slim-born

Slim Framework 3 or 4 skeleton application has authentication MVC construction.

The user authentication has been achieved, there is a need to install and use.

Installation

For Slim 3

bash
composer create-project "havenshen/slim-born v1.0.6" [my-app]

For Slim 4

bash
composer create-project "havenshen/slim-born 2.0" [my-app]

.env

Copy file .env.example to .env

DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=slimborn
DB_USERNAME=root
DB_PASSWORD=
DB_PORT=3306

Router

This is a Slim Framework Router. Reference - Slim Router

php
get('/', 'HomeController:index')->setName('home');

$app->group('', function () {
	$this->get('/auth/signup', 'AuthController:getSignUp')->setName('auth.signup');
	$this->post('/auth/signup', 'AuthController:postSignUp');

	$this->get('/auth/signin', 'AuthController:getSignIn')->setName('auth.signin');
	$this->post('/auth/signin', 'AuthController:postSignIn');
})->add(new GuestMiddleware($container));

Controller

Use Slim Framework Twig View. Reference - Twig-View

php
view->render($response, 'home.twig');
	}
}

Model

Use Laravel PHP Framework Eloquent. Reference - illuminate/database

php
update([
			'password' => password_hash($password, PASSWORD_DEFAULT)
		]);
	}
}

Middleware

php
container->auth->check()) {
			$this->container->flash->addMessage('error', 'Please sign in before doing that');
			return $response->withRedirect($this->container->router->pathFor('auth.signin'));
		}

		$response = $next($request, $response);

		return $response;
	}
}

Validation

Use the most awesome validation engine ever created for PHP. Reference - Respect/Validation

php
validator->validate($request, [
			'email' => v::noWhitespace()->notEmpty()->email()->emailAvailable(),
			'name' => v::noWhitespace()->notEmpty()->alpha(),
			'password' => v::noWhitespace()->notEmpty(),
		]);

		if ($validation->failed()) {
			return $response->withRedirect($this->router->pathFor('auth.signup'));
		}

		//	todo someting
	}
}

More basic functions

reference slim official documents - Slim Framework

Use Packages

  • illuminate/database - It also serves as the database layer of the Laravel PHP framework.
  • Respect/Validation - The most awesome validation engine ever created for PHP.
  • slimphp/Slim - Slim Framework created.
  • slimphp/Slim-Csrf - Slim Framework created.
  • slimphp/Twig-View - Slim Framework created.
  • slimphp/Slim-Flash - Slim Framework created.

Look Feel

Directory Structure

bash
|-- slim-born
	|-- app
		|-- Auth
		|-- Controllers
		|-- Middleware
		|-- Models
		|-- Validation
		|-- Routes.php
	|-- bootstrap
		|-- app.php
	|-- public
	|-- resources
	....

Testing

bash
$ phpunit

Contributing

Feel free to submit any minor enhancements, the goal here is to keep this as simple (yet as practical) as possible.

License

The MIT License (MIT). Please see License File for more information.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPauthenticationmvcmvc-frameworkskeleton

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.