Run composer install to pull in all dependencies
The app can be configured to write to a SQLite file in storage/db.sqlite. To do so, create an empty sqlite file:
touch storage/db.sqlite
- In the project root dir, copy the
.env.examplefile to.env - Edit your
.envfile set the full path to the sqlite file:DB_DATABASE=/full_path_to_project_root/storage/db.sqliteIn the future if you wanted to use something like MySQL or SQL Server all you'd have to do is update the db settings in the config file and then run the db migration scripts. - Create a new app key. This should generate the key and save it to your
.envfile:php artisan key:generate
Run the db migrations scripts. Note: you can also run this in the future to reset the SQLite file to a pristine state:
php artisan migrate:refresh
If you want to seed the SQLite file with test data:
php artisan db:seed
You can either serve the app either by:
- Starting a local development server at http://localhost:8000.
From the project root directory, run:
php artisan serve - Using Apache or Nginx:
- Configure your web server's document root to be the /public directory.
- All files and directories within the
/storageand the/bootstrap/cachedirectories should be made writable by your web server.
The unit and application tests are configured to run against an in-memory sqlite db so it won't have any effect on data in the sqlite file.
Run the tests from project root dir with:
./vendor/bin/phpunit