PHPackages                             mhulse/slim-php-boiler - 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. [Templating &amp; Views](/categories/templating)
4. /
5. mhulse/slim-php-boiler

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

mhulse/slim-php-boiler
======================

So I can get up-and-running with Slim quickly.

1.0.0(9y ago)214[5 issues](https://github.com/mhulse/slim-php-boiler/issues)Apache 2.0PHPPHP &gt;=5.5.0

Since Nov 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mhulse/slim-php-boiler)[ Packagist](https://packagist.org/packages/mhulse/slim-php-boiler)[ Docs](https://github.com/mhulse/slim-php-boiler)[ RSS](/packages/mhulse-slim-php-boiler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Slim PHP Boiler
===============

[](#slim-php-boiler)

**So I can get up-and-running with Slim quickly.**

The code in this repository is heavily based on, and inspired by, [Authentication with Slim 3](https://www.youtube.com/watch?v=RhcQXFeor9g&list=PLfdtiltiRHWGc_yY90XRdq6mRww042aEC) by [@codecourse](https://github.com/codecourse).

Development process
-------------------

[](#development-process)

Suggested development steps follow. Be sure to fully read instructions before modifying code.

### Project directory

[](#project-directory)

Create a git repository:

```
$ cd dev/
$ git init repo-name && cd repo-name
```

Optionally, install my boilerplate dotfiles:

```
$ curl -#L https://github.com/mhulse/gh-boiler/tarball/master | tar -xzv --strip-components 1 --include=*/{.editorconfig,.gitattributes,.gitignore} --exclude=*/**/*
```

At a bare minimum for dotfiles, you should create a `.gitignore` with these lines:

```
composer.phar
vendor/
config.php

```

### Install Composer

[](#install-composer)

Install [Composer](https://getcomposer.org/):

```
$ curl -s http://getcomposer.org/installer | php
```

Official Composer installation instructions [found here](https://getcomposer.org/download/).

Get this code
-------------

[](#get-this-code)

Download the code from this repo using composer:

```
$ php composer.phar create-project mhulse/slim-php-boiler temp
```

Or, using `bash` and `curl`:

```
$ mkdir temp && cd temp && bash  \[after\] deploy\[ing\] your updated `composer.lock`, \[you should\] then re-run `composer install`. You should never run `composer update` in production. If however you deploy a new `composer.lock` with new dependencies and/or versions (after having run `composer update` in dev) \[you can\] then run `composer install` \[and\] Composer will update and install your new dependencies \[onto the production machine’s deployment\].
> – [“composer update” vs “composer install”](http://adamcod.es/2013/03/07/composer-install-vs-composer-update.html)

### Database

[](#database)

In order for this app to work, create a database named `slim-php-boiler` with `UTF-8 Unicode` for the encoding and `utf8_general_ci` for the collation.

Create a `users` table:

```
DROP TABLE IF EXISTS `users`;

CREATE TABLE `users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL DEFAULT '',
  `password` varchar(255) NOT NULL DEFAULT '',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

In the root of the repo, crate a `config.php` (see [`config-sample.php`](config-sample.php)):

```
