|
| 1 | +# Casbin skeleton application with Slim Framework 4 |
| 2 | + |
| 3 | +[](https://travis-ci.org/php-casbin/casbin-with-slim) |
| 4 | +[](https://coveralls.io/github/php-casbin/casbin-with-slim) |
| 5 | +[](https://packagist.org/packages/casbin/casbin-with-slim) |
| 6 | +[](https://packagist.org/packages/casbin/casbin-with-slim) |
| 7 | +[](https://packagist.org/packages/casbin/casbin-with-slim) |
| 8 | + |
| 9 | +Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This application uses the latest Slim 4 with Slim PSR-7 implementation and PHP-DI container implementation. It also uses the Monolog logger. |
| 10 | + |
| 11 | +This skeleton application was built for Composer. This makes setting up a new [Casbin](https://github.com/php-casbin/casbin-with-slim) skeleton application with Slim Framework quick and easy. |
| 12 | + |
| 13 | +## Install the Application |
| 14 | + |
| 15 | +Run this command from the directory in which you want to install your new Slim Framework application. |
| 16 | + |
| 17 | +```bash |
| 18 | +composer create-project casbin/casbin-with-slim [my-app-name] |
| 19 | +``` |
| 20 | + |
| 21 | +Replace `[my-app-name]` with the desired directory name for your new application. You'll want to: |
| 22 | + |
| 23 | +* Point your virtual host document root to your new application's `public/` directory. |
| 24 | +* Ensure `logs/` is web writable. |
| 25 | + |
| 26 | +To run the application in development, you can run these commands |
| 27 | + |
| 28 | +```bash |
| 29 | +cd [my-app-name] |
| 30 | +composer start |
| 31 | +``` |
| 32 | + |
| 33 | +Or you can use PHP Built-in web server: |
| 34 | + |
| 35 | +``` |
| 36 | +php -S localhost:8888 -t public |
| 37 | +``` |
| 38 | + |
| 39 | +Or you can use `docker-compose` to run the app with `docker`, so you can run these commands: |
| 40 | +```bash |
| 41 | +cd [my-app-name] |
| 42 | +docker-compose up -d |
| 43 | +``` |
| 44 | +After that, open `http://localhost:8888` in your browser. |
| 45 | + |
| 46 | +Run this command in the application directory to run the test suite |
| 47 | + |
| 48 | +```bash |
| 49 | +composer test |
| 50 | +``` |
| 51 | + |
| 52 | +That's it! Now go build something cool. |
0 commit comments