mrcoco / slim3-eloquent-skeleton
Simple Slim Framework 3 skeleton with scaffold tool, migrations,Twig,eloquent & Monolog.
Installs: 866
Dependents: 0
Suggesters: 0
Security: 0
Stars: 73
Watchers: 11
Forks: 20
Open Issues: 7
Type:project
Requires
- alexgarrett/violin: ^2.2
- carlosocarvalho/simple-input: ^1.0
- davedevelopment/phpmig: ^1.2
- illuminate/database: ^5.1
- monolog/monolog: ^1.13
- slim/csrf: ^0.5.0
- slim/flash: ^0.1.0
- slim/slim: ^3.0
- slim/twig-view: ^1.1
- symfony/process: ^3.0
- zeuxisoo/slim-whoops: ^0.4.0
This package is auto-updated.
Last update: 2024-12-06 16:08:22 UTC
README
This is a simple skeleton project fork from akrabat/slim3-skeleton that includes scaffold tool, migrations,auth,Twig, Flash messages, eloquent ORM and Monolog.
Create your project:
$ composer create-project -n -s dev mrcoco/slim3-eloquent-skeleton my-app
Run it:
$ cd my-app
- Change database setting
app\setting.php
$ vendor/davedevelopment/phpmig/bin/phpmig migrate
$ php -S 0.0.0.0:8888 -t public public/index.php
- Browse to http://localhost:8888
Key directories
app
: Application codeapp/src
: All class files within theApp
namespaceapp/templates
: Twig template filescache/twig
: Twig's Autocreated cache fileslog
: Log filespublic
: Webserver rootvendor
: Composer dependencies
Key files
public/index.php
: Entry point to applicationapp/settings.php
: Configurationapp/dependencies.php
: Services for Pimpleapp/middleware.php
: Application middlewareapp/routes.php
: All application routes are hereapp/src/Action/HomeAction.php
: Action class for the home pageapp/templates/home.twig
: Twig template file for the home page
CLI Tools
- Currently there are 3 supported commands:
php cli.php create:action MyActionClassName
php cli.php create:middleware MyMiddlewareClassName
php cli.php create:model MyModelClassName
php cli.php create:scaffold MyModuleName
Migration
-
migrate all data
-
php cli.php migrate
-
Confirmation of status
-
php cli.php status
-
Creating // migration file
-
php cli.php generate [MigrationName]
-
//Execution of migration
-
php cli.php migration
-
// I one Back
-
php cli.php rollback
-
// Return all
-
php cli.php rollback -t 0
-
// Go back to the time of completion of the specified MigrationID
-
php cli.php rollback -t [MigrationID]
-
// Only specified MigrationID the migration / roll back
-
php cli.php [up | down] [MigrationID]
Demo User:
admin
username:admin@slim.dev
password:password
moderator
username:moderator@slim.dev
password:password
user
username:user@slim.dev
password:password