Heroku-Laravel
This project is designed to be easily deployed on heroku. It contains the following configuration:
- Procfile with a web process.
- Default Postgres config reading heroku-postgres
DATABASE_URL
.
Running Locally
1. Database, app key, .env
cp .env.example .env
composer install
php artisan key:generate
touch database/database.sqlite
php artisan migrate
2. Run
php artisan serve
Deploying to Heroku
1. Create a Heroku App with postgres addon
Set your own app name on line 1 below
app_name=one-eighty-test
heroku apps:create $app_name
heroku addons:create heroku-postgresql:hobby-dev --app $app_name
2. Add Heroku remote
heroku git:remote --app $app_name
3. Set Config Parameters
To operate correctly you need to set APP_KEY
, APP_LOG
the following prams:
heroku config:set APP_KEY=$(php artisan --no-ansi key:generate --show)
heroku config:set APP_LOG=errorlog
Additionally, to keep the app in development mode and throwing errors set the following:
heroku config:set APP_ENV=development APP_DEBUG=true APP_LOG_LEVEL=debug
4. Deploy to Heroku
git push heroku master
Additional Notes
Trust the load balancer
Depending on what you're doing, you may need to set the application up to trust the Heroku load balancer. See here.
Running a worker process
This Stack Overflow Answer shows a simple addition to the Procfile can run your worker in another process.
Using --daemon
is not necessary in Laravel 5.4 and setting up your queues on redit (or using the DB) is not part of this project at this point.
queue: php artisan queue:work redis --sleep=3 --tries=3
About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked.
Learning Laravel
Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The Laravel documentation is thorough, complete, and makes it a breeze to get started learning the framework.
If you're not in the mood to read, Laracasts contains over 900 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.
Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
License
The Laravel framework is open-sourced software licensed under the MIT license.