Skip to content

Commit fff3fa3

Browse files
authored
Merge pull request #186 from pacoorozco/issue-183
Upgrade gamify-laravel to Laravel 8.x
2 parents e59dba2 + b092a35 commit fff3fa3

File tree

344 files changed

+13625
-5442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+13625
-5442
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ BROADCAST_DRIVER=log
6464
QUEUE_CONNECTION=sync
6565

6666
LOG_CHANNEL=stack
67+
LOG_LEVEL=debug
6768

6869
MAIL_MAILER=smtp
69-
MAIL_HOST=smtp.mailtrap.io
70-
MAIL_PORT=2525
70+
MAIL_HOST=mailhog
71+
MAIL_PORT=1025
7172
MAIL_USERNAME=null
7273
MAIL_PASSWORD=null
7374
MAIL_ENCRYPTION=null

.env.travis

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,77 @@
1-
# .env.travis
2-
3-
APP_NAME=GAMIFY
1+
# Configuration for Travis jobs
2+
APP_NAME=Gamify
43
APP_ENV=testing
5-
APP_KEY=base64:KYGGyNe20C0PeTfNQk7foGJz7vor/iXFXRkAOPgeYAM=
4+
APP_KEY=
65
APP_DEBUG=true
76
APP_URL=http://localhost
87

8+
# Database configuration.
99
DB_CONNECTION=mysql
10-
DB_HOST=localhost
10+
DB_HOST=127.0.0.1
1111
DB_PORT=3306
1212
DB_DATABASE=testing
1313
DB_USERNAME=travis
1414
DB_PASSWORD=
1515

16-
BCRYPT_ROUNDS=4
16+
# Cache configuration.
17+
#
18+
# For Redis, use 'CACHE_DRIVER=redis' and set 'REDIS_*' variables below.
1719
CACHE_DRIVER=array
18-
QUEUE_CONNECTION=sync
20+
21+
# Session manager configuration.
22+
#
23+
# For Redis, use 'SESSION_DRIVER=redis' and set 'REDIS_*' variables below.
1924
SESSION_DRIVER=array
20-
MAIL_DRIVER=array
2125

26+
# Redis configuration.
27+
REDIS_HOST=127.0.0.1
28+
REDIS_PASSWORD=null
29+
REDIS_PORT=6379
30+
31+
# Multi-auth configuration.
32+
# See 'config/services.php' to know how to enable OAuth providers.
33+
#
34+
# For okta OAuth, set these variables.
35+
OKTA_KEY=
36+
OKTA_SECRET=
37+
OKTA_REDIRECT_URI=
38+
OKTA_BASE_URL=
39+
40+
# External storage service configuration.
41+
# Define which disk will be used for uploads (user, badge and level's images).
42+
#
43+
# Default value (commented) is 'public' disk (see 'config/filesystems.php').
44+
#
45+
# You can use any available disk at 'disks' (see 'config/filesystems.php').
46+
#
47+
# For AWS S3, uncomment it, set 'UPLOAD_DISK=s3' and set 'AWS_*' variables below.
48+
# UPLOAD_DISK=public
49+
50+
# AWS S3 configuration.
51+
# Set 'UPLOAD_DISK=s3' to upload images to AWS.
52+
AWS_ACCESS_KEY_ID=
53+
AWS_SECRET_ACCESS_KEY=
54+
AWS_DEFAULT_REGION=
55+
AWS_BUCKET=
56+
57+
# Trusted proxies configuration
58+
# @see 'config/trustedproxy.php' to know how to configure these trusted proxies.
59+
TRUSTED_PROXIES=
60+
TRUSTED_HEADERS=
61+
62+
# -----[ DO NOT TOUCH BELOW THIS POINT ]-----
63+
#
64+
BROADCAST_DRIVER=log
65+
QUEUE_CONNECTION=sync
66+
67+
LOG_CHANNEL=stack
68+
LOG_LEVEL=debug
69+
70+
MAIL_MAILER=array
71+
MAIL_HOST=mailhog
72+
MAIL_PORT=1025
73+
MAIL_USERNAME=null
74+
MAIL_PASSWORD=null
75+
MAIL_ENCRYPTION=null
76+
MAIL_FROM_ADDRESS=null
77+
MAIL_FROM_NAME="${APP_NAME}"

.symfony.insight.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ before_script:
2929
script:
3030
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
3131

32-
after_script:
32+
after_success:
3333
- wget https://scrutinizer-ci.com/ocular.phar
3434
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/).
55

66
## Unreleased
7+
> **Note**: This application has been updated to use [Laravel 8.x](https://laravel.com/docs). It's backwards compatibility, so the database does not need to be updated.
8+
9+
### Changed
10+
- **Important**: This application has been upgraded to [Laravel 8.x](https://laravel.com/docs). A lot of refactors has been done in order to adopt Laravel 8.x best practices.
11+
712
### Fixed
813
- Bug when creating a question without choices. ([#177][i177])
914

README.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/pacoorozco/gamify-laravel/badges/quality-score.png)](https://scrutinizer-ci.com/g/pacoorozco/gamify-laravel)
55
[![Code Coverage](https://scrutinizer-ci.com/g/pacoorozco/gamify-laravel/badges/coverage.png)](https://scrutinizer-ci.com/g/pacoorozco/gamify-laravel)
66
[![License](https://img.shields.io/github/license/pacoorozco/gamify-laravel.svg)](LICENSE)
7-
[![Laravel Version](https://img.shields.io/badge/Laravel-6.x-orange.svg)](https://laravel.com/docs/6.x)
7+
[![Laravel Version](https://img.shields.io/badge/Laravel-8.x-orange.svg)](https://laravel.com/docs/8.x)
88
[![GitHub release](https://img.shields.io/github/release/pacoorozco/gamify-laravel.svg?style=flat-square)](https://github.com/pacoorozco/gamify-laravel/releases)
99

1010
## Presentation
@@ -40,28 +40,20 @@ Prior this installation, you **need to have installed** this software:
4040
$ git clone https://github.com/pacoorozco/gamify-laravel.git gamify
4141
$ cd gamify
4242
```
43-
1. Install PHP dependencies with:
44-
45-
> **NOTE**: You don't need to install neither _PHP_ nor _Composer_, we are going to use a [Composer image](https://hub.docker.com/_/composer/) instead.
46-
47-
```bash
48-
$ docker run --rm --interactive --tty \
49-
--volume $PWD:/app \
50-
--user $(id -u):$(id -g) \
51-
composer install
52-
```
53-
5443
1. Copy [`.env.example`](.env.example) to `.env`.
5544

5645
> **NOTE**: You don't need to touch anything from this file. It works with default settings.
5746
5847
1. Start all containers with [Docker Compose](https://docs.docker.com/compose/)
5948
49+
> **NOTE**: You **must** export the `DOCKER_APP_UID` variable if your user ID is different from `1000`. This will allow the docker to get permissions over your files.
50+
6051
```bash
52+
$ export DOCKER_APP_UID="$(id -u)"
6153
$ docker-compose build
6254
$ docker-compose up -d
6355
```
64-
56+
6557
1. Seed database in order to play with some data
6658
6759
```bash

app/Console/Kernel.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
namespace Gamify\Console;
2727

28+
use Illuminate\Console\Scheduling\Schedule;
2829
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
2930

3031
class Kernel extends ConsoleKernel
@@ -38,6 +39,17 @@ class Kernel extends ConsoleKernel
3839
//
3940
];
4041

42+
/**
43+
* Define the application's command schedule.
44+
*
45+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
46+
* @return void
47+
*/
48+
protected function schedule(Schedule $schedule)
49+
{
50+
// $schedule->command('inspire')->hourly();
51+
}
52+
4153
/**
4254
* Register the commands for the application.
4355
*

app/Enums/BadgeActuators.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
<?php
2+
/**
3+
* Gamify - Gamification platform to implement any serious game mechanic.
4+
*
5+
* Copyright (c) 2018 by Paco Orozco <[email protected]>
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* Some rights reserved. See LICENSE and AUTHORS files.
18+
*
19+
* @author Paco Orozco <[email protected]>
20+
* @copyright 2018 Paco Orozco
21+
* @license GPL-3.0 <http://spdx.org/licenses/GPL-3.0>
22+
*
23+
* @link https://github.com/pacoorozco/gamify-laravel
24+
*/
225

326
namespace Gamify\Enums;
427

app/Enums/QuestionActuators.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
<?php
2+
/**
3+
* Gamify - Gamification platform to implement any serious game mechanic.
4+
*
5+
* Copyright (c) 2018 by Paco Orozco <[email protected]>
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* Some rights reserved. See LICENSE and AUTHORS files.
18+
*
19+
* @author Paco Orozco <[email protected]>
20+
* @copyright 2018 Paco Orozco
21+
* @license GPL-3.0 <http://spdx.org/licenses/GPL-3.0>
22+
*
23+
* @link https://github.com/pacoorozco/gamify-laravel
24+
*/
225

326
namespace Gamify\Enums;
427

app/Events/PointCreated.php

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
<?php
2+
/**
3+
* Gamify - Gamification platform to implement any serious game mechanic.
4+
*
5+
* Copyright (c) 2018 by Paco Orozco <[email protected]>
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* Some rights reserved. See LICENSE and AUTHORS files.
18+
*
19+
* @author Paco Orozco <[email protected]>
20+
* @copyright 2018 Paco Orozco
21+
* @license GPL-3.0 <http://spdx.org/licenses/GPL-3.0>
22+
*
23+
* @link https://github.com/pacoorozco/gamify-laravel
24+
*/
225

326
namespace Gamify\Events;
427

5-
use Gamify\Point;
28+
use Gamify\Models\Point;
629
use Illuminate\Foundation\Events\Dispatchable;
730
use Illuminate\Queue\SerializesModels;
831

932
class PointCreated
1033
{
1134
use Dispatchable, SerializesModels;
1235

13-
/** @var \Gamify\User */
36+
/** @var \Gamify\Models\User */
1437
public $user;
1538

1639
/** @var int */
@@ -19,7 +42,7 @@ class PointCreated
1942
/**
2043
* Create a new event instance.
2144
*
22-
* @param \Gamify\Point $point
45+
* @param \Gamify\Models\Point $point
2346
*
2447
* @return void
2548
*/

0 commit comments

Comments
 (0)