2017 © Pedro Peláez

project slim3-starter

Slim 3 fullstack starter



Slim 3 fullstack starter

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 100 % Grown


Important UPDATE:

I've published a fresher, improved version of this project under the name of slim3-flex. If you like clean, beautiful code, you certainly wanna check it out! :), (*1)

slim3-starter : A fullstack boilerplate for Slim 3

A Slim 3 starter project with a clean directory structure, inspired from Laravel. This source code provides the most essential setup & libraries to help deal with most of the needs any web application has., (*2)

Features :

  • MVC architecture
  • Clean dependency injection & autowiring system with the php-DI bridge for Slim 3
  • Config variables laying in a simple .env file
  • Twig as a template engine
  • Full form validation features with custom rules and errors (See : respect/validation library)
  • Data persistance via Eloquent ORM
  • Pagination with Eloquent's paginator
  • Events and listeners/handlers classes based on the SPL library
  • Mailable classes using the popular SwiftMailer library
  • CSRF protection for web routes
  • Custom 403/404 errors
  • Handy debug() function using the symfony/vardumper library
  • SQL query caching with Redis
  • Integrated logging with Monolog
  • JSON formatting with Fractal
  • Database seeding and migrations with Phinx

Setting up :

Once you've downloaded or cloned the project, fill the variables in the .env file. Set APP_ENV=dev to enable debugging and disable Twig caching at the same time. Then run :, (*3)

  composer install
  ./vendor/bin/phinx migrate
  ./vendor/bin/phinx seed:run

Using Sqlite instead of MySQL

In your .env file, set DB_DRIVER=sqlite and DB_NAME=absolute_path_to_sqlite ., (*4)

I recommend creating the .sqlite file within the /storage directory., (*5)

  • PhpStorm + Vagrant homestead

If you are using homestead's Redis server, remember to edit /etc/redis/redis.conf and fill the requirepass line with your own password., (*6)

The Versions