|
| 1 | +# Laravel Pure Code Sample |
| 2 | +## Running the example locally |
| 3 | +### 1. Install the dependencies |
| 4 | +Run `composer install` in this folder to download all Laravel dependencies. |
| 5 | + |
| 6 | +### 2. Initiate the database |
| 7 | +By default, we have configured a local sqlite database inside the `database` folder. |
| 8 | + |
| 9 | +If you want to connect to another database, please edit the `.env` file and refer to the laravel documention for other configuration options. |
| 10 | + |
| 11 | +Initiate the database structure with this command : `php artisan migrate` |
| 12 | + |
| 13 | +### 3. Start the local server |
| 14 | +Run `php artisan serve` to start a local server on [localhost:8000](http://localhost:8000). |
| 15 | + |
| 16 | +### 4. Enjoy |
| 17 | +The default configuration will log you in and display all your informations |
| 18 | + |
| 19 | +## How does it work |
| 20 | + |
| 21 | +### 1. Register the routes |
| 22 | +We need to tell Laravel about our 2 new routes, the one that will redirect the user to SSO and the one the user will be redirected to after a successful login. |
| 23 | + |
| 24 | +They are located in the `routes/web.php` file |
| 25 | + |
| 26 | +### 2. Add a controller |
| 27 | + |
| 28 | +Now that the routes exist, we need to tell laravel what do to when a user is accessing them. |
| 29 | + |
| 30 | +We have copied the example from `php-pure` into `app/Http/Controllers/IvaoController.php` |
| 31 | + |
| 32 | +### 3. Specify the variables |
| 33 | +Inside `.env` we have specified the `IVAO_CLIENT_ID` and `IVAO_CLIENT_SECRET` values that will authenticate our application. |
| 34 | + |
| 35 | +## Known bugs |
| 36 | + |
| 37 | +### 127.0.0.1 Invalid Redirect URI |
| 38 | +If you open the URL on `http://127.0.0.1:8000` it won't work because the redirect url doesn't allow an IP. You have to open it from [http://localhost:8000](http://localhost:8000) to make it work. |
| 39 | + |
| 40 | +## Contribution |
| 41 | + |
| 42 | +Thank you for your contribution to this code sample and testing : |
| 43 | + - [Edgardo Alvarez (602243) CO-WM](https://github.com/edgardoalvarez100) |
| 44 | + - [DZ-WM (670202)](https://github.com/belmeg) |
0 commit comments