Laravel with FusionAuth Example
This app is an example Laravel application. It delegates user management, registration and login to FusionAuth. It uses a middleware to ensure that only signed in users can access certain pages.
Read more about how to set this up and run it HERE.
Setting up this rep
- Run
composer install(orcomposer updateif prompted) - Rename
example.envto.env - Update
.envfile and add three keys and their appropriate value:- FUSIONAUTH_APP_ID=<your_app_id>
- FUSIONAUTH_API_KEY=<your_api_key>
- FUSIONAUTH_BASE_URL=<where_fusionauth_is_running_usually_
http://localhost:9011>
- If you run into trouble and see these screens, you can try the fixes below.
- Please execute these commands from the root directory of the project in the terminal.
php artisan key:generate- This will generate a unique
APP_KEY. See more here - You can also click the
generate app keybutton and have this done for you in the UI (as shown)
- This will generate a unique
sudo chmod -R 777 vendor- This will allow everyone to write and execute your vendor files in the project.
Git Log
This Git history follows the headings on the tutorial. Each commit SHA follows the progress of the tutorial, header by header. One can checkout each commit and see the code in realtime if you get stuck following along (or use Github to view the diff).
| SHA | Heading in Tutorial |
|---|---|
| 6378981 | Logging out |
| c385639 | Showing the current user’s profile |
| f9cfff1 | Logging a user in |
| 8260d3d | Registering a new user |
| b87d132 | Installing and configuring the FusionAuth PHP package |
| 5734d71 | Setting up a new Laravel Application |
Requirements
- This example application was tested using:
- Php 7.2