Boilerplate for Slim Framework 3

Overview

Boilerplate for Slim Framework 3 Build Status Donate

Boilerplate for getting started with Slim Framework

Use this skeleton application to quickly setup and start working on a new Slim Framework 3 application. This application uses the latest Slim 3.

Requirements:

  • PHP 5.5 or newer
  • PDO PHP Extension

Features

  • PHP View
  • Twig Template Engine
  • Eloquent Laravel
  • Sentinel Authentication provider
  • Include SDK Facebook
  • Logger Monolog
  • AdminLTE soon
1 Manual Install

You can manually install by cloning this repo or download the zip file from this repo, and run composer install.

$ git clone https://github.com/zhiephie/boilerplate-slim3.git
$ composer install
2 Alternative install via composer
$ composer create-project --no-interaction --stability=dev zhiephie/boilerplate-slim3 [folder-name]
3 Setup Permission

After composer finished install the dependencies, you need to change file and folder permission.

$ chmod -R 777 storage
$ chmod 666 config/database.php
4 Configuration Database and Setting App

Configuration file located in config, edit the database.php, setting.php

5 Run php migrate
$ php migrate
6 Run Server php -S localhost:8000 -t public
$ php -S localhost:8000 -t public

That's it! Now go build something cool.

Comments
  • Running php migrate returns errors

    Running php migrate returns errors

    C:\Ampps\www\boilerplate-slim3 (master)
    λ php migrate
    PHP Fatal error:  Uncaught PDOException: could not find driver in C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php:55
    Stack trace:
    #0 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php(55): PDO->__construct('mysql:host=loca...', 'root', 'mysql', Array)
    #1 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
    #2 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\ConnectionFactory.php(61): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
    #3 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
    #4 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connection.php(864): call_user_func(Object(Closure))
    #5 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connection.php(732): Illuminate\Database\Connection->getPdo()
    #6 C:\Ampps\www\b in C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php on line 55
    
    Fatal error: Uncaught PDOException: could not find driver in C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php:55
    Stack trace:
    #0 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php(55): PDO->__construct('mysql:host=loca...', 'root', 'mysql', Array)
    #1 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
    #2 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\ConnectionFactory.php(61): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
    #3 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
    #4 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connection.php(864): call_user_func(Object(Closure))
    #5 C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connection.php(732): Illuminate\Database\Connection->getPdo()
    #6 C:\Ampps\www\b in C:\Ampps\www\boilerplate-slim3\vendor\illuminate\database\Connectors\Connector.php on line 55
    
    opened by visualcookie 4
  • PHP migrate fire errors on step 5

    PHP migrate fire errors on step 5

    I've followed your instructions to set up your boilerplate, but I got these errors when running migrate.

    Fatal error: Uncaught exception 'Illuminate\Contracts\Container\BindingResolutionException' with message 'Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable.' in /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/container/Container.php:763
    Stack trace:
    #0 /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/container/Container.php(644): Illuminate\Container\Container->build('Illuminate\\Cont...', Array)
    #1 /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/database/Connectors/ConnectionFactory.php(130): Illuminate\Container\Container->make('Illuminate\\Cont...')
    #2 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
    #3 /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/database/Connection.php(964): call_user_func(Object(Closure))
    #4 /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/database/Connection.php(832): Illuminate\Database\Connection->getPdo()
    #5 /Volumes/data/Sites/scotch-box/publi in /Volumes/data/Sites/scotch-box/public/slim/vendor/illuminate/container/Container.php on line 763
    
    opened by faridsa 3
  • Bump symfony/http-foundation from 3.0.3 to 3.4.35

    Bump symfony/http-foundation from 3.0.3 to 3.4.35

    Bumps symfony/http-foundation from 3.0.3 to 3.4.35.

    Changelog

    Sourced from symfony/http-foundation's changelog.

    CHANGELOG

    5.2.0

    • added support for X-Forwarded-Prefix header
    • added HeaderUtils::parseQuery(): it does the same as parse_str() but preserves dots in variable names
    • added File::getContent()
    • added ability to use comma separated ip addresses for RequestMatcher::matchIps()
    • added Request::toArray() to parse a JSON request body to an array
    • added RateLimiter\RequestRateLimiterInterface and RateLimiter\AbstractRequestRateLimiter
    • deprecated not passing a Closure together with FILTER_CALLBACK to ParameterBag::filter(); wrap your filter in a closure instead.
    • Deprecated the Request::HEADER_X_FORWARDED_ALL constant, use either HEADER_X_FORWARDED_FOR | HEADER_X_FORWARDED_HOST | HEADER_X_FORWARDED_PORT | HEADER_X_FORWARDED_PROTO or HEADER_X_FORWARDED_AWS_ELB or HEADER_X_FORWARDED_TRAEFIK constants instead.

    5.1.0

    • added Cookie::withValue, Cookie::withDomain, Cookie::withExpires, Cookie::withPath, Cookie::withSecure, Cookie::withHttpOnly, Cookie::withRaw, Cookie::withSameSite
    • Deprecate Response::create(), JsonResponse::create(), RedirectResponse::create(), and StreamedResponse::create() methods (use __construct() instead)
    • added Request::preferSafeContent() and Response::setContentSafe() to handle "safe" HTTP preference according to RFC 8674
    • made the Mime component an optional dependency
    • added MarshallingSessionHandler, IdentityMarshaller
    • made Session accept a callback to report when the session is being used
    • Add support for all core cache control directives
    • Added Symfony\Component\HttpFoundation\InputBag
    • Deprecated retrieving non-string values using InputBag::get(), use InputBag::all() if you need access to the collection of values

    5.0.0

    • made Cookie auto-secure and lax by default
    • removed classes in the MimeType namespace, use the Symfony Mime component instead
    • removed method UploadedFile::getClientSize() and the related constructor argument
    • made Request::getSession() throw if the session has not been set before
    • removed Response::HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL
    • passing a null url when instantiating a RedirectResponse is not allowed

    4.4.0

    • passing arguments to Request::isMethodSafe() is deprecated.
    • ApacheRequest is deprecated, use the Request class instead.
    • passing a third argument to HeaderBag::get() is deprecated, use method all() instead

    ... (truncated)

    Commits
    • 9e4b3ac [HttpFoundation] fix guessing mime-types of files with leading dash
    • a5d46a3 Fix MockFileSessionStorageTest::sessionDir being used after it's unset
    • 7b4626a Remove unused local variables in tests
    • 4db558c Add plus character + to legal mime subtype
    • 233f40c [HttpFoundation] Check if data passed to SessionBagProxy::initialize is an array
    • 35ffbbf [HttpFoundation] allow additinal characters in not raw cookies
    • ec2a74a Call AssertEquals with proper parameters
    • 089da40 Return null as Expire header if it was set to null
    • b3d57a1 [HttpFoundation] fix return type declarations
    • 9781d8d Fix inconsistent return points.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump phpmailer/phpmailer from 5.2.14 to 6.1.6

    Bump phpmailer/phpmailer from 5.2.14 to 6.1.6

    Bumps phpmailer/phpmailer from 5.2.14 to 6.1.6.

    Release notes

    Sourced from phpmailer/phpmailer's releases.

    PHPMailer 6.1.6

    This is a security release, with some other minor changes. For full details, refer to the advisory.

    • SECURITY Fix insufficient output escaping bug in file attachment names. CVE-2020-13625. Reported by Elar Lang of Clarified Security.
    • Correct Armenian ISO language code from am to hy, add mapping for fallback
    • Use correct timeout property in debug output

    PHPMailer 6.1.5

    This is a maintenance release.

    • Reject invalid custom headers that are empty or contain breaks
    • Various fixes for DKIM issues, especially when using mail() transport
    • Drop the l= length tag from DKIM signatures; it's a mild security risk
    • Ensure CRLF is used explicitly when needed, rather than static::$LE
    • Add a method for trimming header content consistently
    • Some minor tweaks to resolve static analyser complaints
    • Check that attachment files are readable both when adding and when sending
    • Work around Outlook bug in mishandling MIME preamble
    • Danish translation improvements

    PHPMailer 6.1.4

    The RFC2047 folding added in 6.1.0 was a little overenthusiastic; It will now only happen when header lines exceed 998 chars.

    • Clean up hostname handling
    • Avoid IDN error on older PHP versions, prep for PHP 8.0
    • Don't force RFC2047 folding unnecessarily
    • Enable tests on full release of PHP 7.4

    PHPMailer 6.1.3

    • Fix an issue preventing injected debug handlers from working
    • Fix an issue relating to connection timeout
    • Add SMTP::MAX_REPLY_LENGTH constant
    • Remove some dev dependencies; phpdoc no longer included
    • Fix an issue where non-compliant servers returning bare codes caused an SMTP hang

    PHPMailer 6.1.2

    • Substantial revision of DKIM header generation
    • Use shorter hashes for auto-generated CID values
    • Fix format of content-id headers, and only use them for inline attachments
    • Remove all use of XHTML
    • Lots of coding standards cleanup
    • API docs are now auto-updated via GitHub actions
    • Fix header separation bug created in 6.1.1
    • Fix misidentification of background attributes in SVG images in msgHTML

    PHPMailer 6.1.1

    No code changes, just retagging for a misordered commit for 6.1.0.

    PHPMailer 6.1.0

    ... (truncated)

    Changelog

    Sourced from phpmailer/phpmailer's changelog.

    Version 6.1.6 (May 27th, 2020)

    • SECURITY Fix insufficient output escaping bug in file attachment names. CVE-2020-13625. Reported by Elar Lang of Clarified Security.
    • Correct Armenian ISO language code from am to hy, add mapping for fallback
    • Use correct timeout property in debug output

    Version 6.1.5 (March 14th, 2020)

    • Reject invalid custom headers that are empty or contain breaks
    • Various fixes for DKIM issues, especially when using mail() transport
    • Drop the l= length tag from DKIM signatures; it's a mild security risk
    • Ensure CRLF is used explicitly when needed, rather than static::$LE
    • Add a method for trimming header content consistently
    • Some minor tweaks to resolve static analyser complaints
    • Check that attachment files are readable both when adding and when sending
    • Work around Outlook bug in mishandling MIME preamble
    • Danish translation improvements

    Version 6.1.4 (December 10th, 2019)

    • Clean up hostname handling
    • Avoid IDN error on older PHP versions, prep for PHP 8.0
    • Don't force RFC2047 folding unnecessarily
    • Enable tests on full release of PHP 7.4

    Version 6.1.3 (November 21st, 2019)

    • Fix an issue preventing injected debug handlers from working
    • Fix an issue relating to connection timeout
    • Add SMTP::MAX_REPLY_LENGTH constant
    • Remove some dev dependencies; phpdoc no longer included
    • Fix an issue where non-compliant servers returning bare codes caused an SMTP hang

    Version 6.1.2 (November 13th, 2019)

    • Substantial revision of DKIM header generation
    • Use shorter hashes for auto-generated CID values
    • Fix format of content-id headers, and only use them for inline attachments
    • Remove all use of XHTML
    • Lots of coding standards cleanup
    • API docs are now auto-updated via GitHub actions
    • Fix header separation bug created in 6.1.1
    • Fix misidentification of background attributes in SVG images in msgHTML

    Version 6.1.1 (September 27th 2019)

    • Fix misordered version tag

    Version 6.1.0 (September 27th 2019)

    • Multiple bug fixes for folding of long header lines, thanks to @caugner
    • Add support for RFC2387 child element content-type hint in multipart/related structures.
    • Support for Ical event methods other than REQUEST, thanks to @puhr-mde
    • Change header folding and param separation to use spaces instead of tabs
    • Use ; to separate multiple MIME header params
    • Add support for RFC3461 DSN messages
    • IMAP example code fixed

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Container values registered not available in controllers available inside route.php

    Container values registered not available in controllers available inside route.php

    Hi, I have created a container variable like this

    $container['common'] = function ($c) {

    $common = new App\Services\Common($c);
    return $common;
    

    };

    in dependency.php, so now I want to get this in one of my controllers without dependency injection I am able to get this inside my route.php like this $this->common->getPath();

    So please help how to get this globally available inside my controllers

    opened by sooraj007 0
Releases(v1.0)
Owner
Yudi Purwanto
Software Engineer @TimexStudio
Yudi Purwanto
Rest API boilerplate for Lumen micro-framework.

REST API with Lumen 5.5 A RESTful API boilerplate for Lumen micro-framework. Features included: Users Resource OAuth2 Authentication using Laravel Pas

Hasan Hasibul 484 Sep 16, 2022
Slim Framework 4 Skeleton Application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

Cleonildo Soares Guimaraes Junior 5 Nov 21, 2021
Simple skeleton for the PHP Slim framework

Simple skeleton for the PHP Slim framework

Andrew S Erwin 2 Nov 13, 2021
Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

Slim Framework 1.5k Dec 25, 2022
SPA Skeleton with Mithril.js and Slim Framework

A single-page application (SPA) skeleton based on Mithril.js and Slim Framework 4 trying to use good practices

tebe 5 Oct 23, 2022
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

Dwij IT Solutions 1.5k Dec 29, 2022
A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0

AdminLTE template Laravel package A Laravel package that switch default Laravel scaffolding / boilerplate to AdminLTE template with Bootstrap 3.0 and

Sergi Tur Badenas 1.8k Jan 3, 2023
:computer: :octocat: A hackathon/MVP boilerplate for laravel web applications. Start your hackathons without hassle.

Laravel Hackathon Starter - SUSUMU 進 If you have attended any hackathons in the past, then you know how much time it takes to get a project started: d

Prosper Otemuyiwa 1.6k Dec 17, 2022
A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.

Laravel API Boilerplate (JWT Edition) for Laravel 5.8 Laravel API Boilerplate is a "starter kit" you can use to build your first API in seconds. As yo

Francesco Malatesta 1.2k Dec 18, 2022
:elephant: A Laravel 6 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.

Laravel Vue Boilerplate A Laravel 6 Single Page Application boilerplate using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass and Pug with: A users

Alefe Souza 533 Jan 3, 2023
A boilerplate single php file for all your needs, no frameworks, no libraries.

SINGLE PHP FILE A boilerplate single php file for all your needs, no frameworks, no libraries. Avoid repetitive work It is a well known architecture d

null 15 Dec 30, 2022
High scalable boilerplate for Laravel - Vue using laravel-mix.

Why use this ? This boilerplate make developer easier to make monolith Laravel project which integrated with Vue.js and vue-router as default front-en

Carvel Saputra Martaloho 5 Sep 21, 2022
A Laravel 8 and Vue 3 SPA boilerplate using tailwind styling and sanctum for authentication :ghost:

Laravel Vue Sanctum SPA Laravel and vue spa using tailwind (laravel/ui looks) for styling and sanctum for authentification Features Laravel 8 Vue + Vu

Hijen EL Khalifi 62 Dec 5, 2022
Laravel Boilerplate with AdminLTE Theme

Welcome to FastLaravel Laravel Boilerplate for AdminLTE Theme Laravel Boilerplate with AdminLTE Theme with FastLaravel.

FastX Group 49 Dec 15, 2022
Modular Laravel - Boilerplate project starter

MODULAR About Modular Laravel This project is a personal blueprint starter with customized modular / SOA architecture. Kostadin Keljtanoski Install Yo

Kostadin Keljtanoski 41 Nov 21, 2022
WP React Plugin Boilerplate - WordPress Setting via React and Rest API

WP React Plugin Boilerplate is a starter WordPress plugin to develop WordPress Plugin via React and Rest API. WP React Plugin Boilerplate WP React Plu

Santosh Kunwar 36 Dec 6, 2022
Hassle-free Laravel + Inertiajs + Svelte + TailwindCSS Boilerplate

Hassle-free Laravel + Inertiajs + Svelte + TailwindCSS Boilerplate

Michael S 46 Dec 31, 2022
Boilerplate for a standard tested resourceful Laravel app

Gold Standard A Laravel boilerplate resource This repo is an example of what I consider to be my "gold standard" of a resource-oritented application w

Dwight Watson 25 Mar 19, 2019
Laravel and AngularJS Starter Application Boilerplate featuring Laravel 5.3 and AngularJS 1.5.8

?? Zemke/starter-laravel-angular has been upgraded to AngularJS 1.5.8. ?? Zemke/starter-laravel-angular has been upgraded to Laravel 5.3. You can pull

Florian Zemke 372 Nov 21, 2022