Skip to content

hollylawly/travel-planet-crud

Repository files navigation

Laravel 6.0 CRUD Application w/ Authentication

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.

Laravel 6 crud travel app demo screenshot

Laravel 6 crud travel app demo user account/dashboard screenshot

Installation

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

Setup Homestead

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

Create, Migrate, and Seed the Database

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

Book a Trip!

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.

Suspend the VM

Once you're done playing around, remember to suspend your VM.

vagrant suspend

About

Create a CRUD application with Laravel 6 and Auth0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages