Let's build this a reservation management system using Laravel 6.0 and Auth0!
You can follow along with the tutorial (highly recommended) or skip straight to the goodies by following the instructions below.
Clone the repo
git clone https://github.com/hollylawly/travel-planet-crud.git
Switch into the newly created repo folder
cd travel-planet-crud
Install the dependencies
composer install
npm install
Create the .env
file
mv .env.example .env
Generate encryption key
php artisan key:generate
Signup for Auth0 account
This application requires users to login. To make sure everything is works correctly, you need to sign up for a free Auth0 account.
Click on "Applications" and then create a new application. Name it anything you'd like and select "Regular web app".
Scroll down and find "Allowed callback URLs". Fill this in with the URL you've been using for your application and then add auth0/callback
to the end. E.g. http://homestead.test/auth0/callback
.
Fill in the "Logout URL" with just the URL. E.g. http://homestead.test
.
There are three Auth0 values on this page that you'll need to fill in in your .env
file. Check out the tutorial for more information about this.
AUTH0_DOMAIN=your-auth0-domain.auth0.com
AUTH0_CLIENT_ID=your-client-id
AUTH0_CLIENT_SECRET=your-client-secret
If you don't already have VirtualBox and Vagrant setup, I recommend reading through that section of the tutorial.
Otherwise, generate your Homestead.yaml
file now.
Mac or Linux:
php vendor/bin/homestead make
Windows:
vendor\\bin\\homestead make
You might need to updating your folder mapping. Just replace /path/to/the/repo/travel-planet-crud
with the full path to wherever you cloned this repo.
folders:
-
map: /path/to/the/repo/travel-planet-crud
to: /home/vagrant/code
Once you have your updated Homestead.yaml
file, start your VM with:
vagrant up
SSH into your VM
vagrant ssh
cd code
Run the migrations
php artisan migrate
Seed the database
php artisan db:seed
Exit the VM
exit
Now just head to http://localhost:8000/
to check out your new Laravel 6 reservation booking system! Go ahead and sign up, head to the hotels page, and make some new reservations.
Once you're done playing around, remember to suspend your VM.
vagrant suspend