Skip to content

Commit

Permalink
Merge pull request #78 from mchekin/to-laravel-8
Browse files Browse the repository at this point in the history
Update Laravel to version 8
  • Loading branch information
mchekin authored Jun 28, 2021
2 parents babf564 + 078119e commit 0437d4e
Show file tree
Hide file tree
Showing 139 changed files with 6,148 additions and 5,009 deletions.
27 changes: 22 additions & 5 deletions .env.docker.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
APP_NAME="Browser Adventure"
APP_ENV=local
APP_KEY=base64:UgFA9JbLHEsBMRFwJmwGIrlp8+3BfDaaj9Hxu7H3NFw=
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8080

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql

DB_HOST=db
Expand All @@ -14,22 +17,36 @@ DB_PASSWORD=secret_password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

MAX_FILE_SIZE=40M
MAX_FILE_SIZE=40M
25 changes: 21 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,43 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=sqlite

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

MAX_FILE_SIZE=40M
MAX_FILE_SIZE=40M
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ CHANGELOG.md export-ignore

# Files to keep with LF endings, even on Windows
*.sh text eol=lf
/docker/cron/scheduler eol=lf
/docker/mysql/my.cnf eol=lf
/docker/nginx/conf.d/app.conf eol=lf
/docker/php/local.ini eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/.idea
.env
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
Expand Down
7 changes: 2 additions & 5 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
php:
preset: laravel
enabled:
- length_ordered_imports
disabled:
- alpha_ordered_imports
- unused_use
- no_unused_imports
finder:
not-name:
- index.php
Expand All @@ -13,4 +10,4 @@ js:
finder:
not-name:
- webpack.mix.js
css: true
css: true
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Console;

use App\Character;
use App\Models\Character;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

Expand Down
9 changes: 5 additions & 4 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontFlash = [
'current_password',
'password',
'password_confirmation',
];
Expand All @@ -35,12 +36,12 @@ class Handler extends ExceptionHandler
*
* @param \Throwable $exception
* @return void
*
* @throws Exception
*/
public function report(\Throwable $exception)
public function register()
{
parent::report($exception);
$this->reportable(function (Throwable $e) {
//
});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Modules\User\Application\Services\UserService;
use App\Modules\User\UI\Http\CommandMappers\CreateUserCommandMapper;
use App\Http\Controllers\Controller;
use App\User;
use App\Models\User;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/BattleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Battle;
use App\Models\Battle;

class BattleController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/CharacterBattleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;

class CharacterBattleController extends Controller
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/CharacterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;
use App\Modules\Character\Application\Services\CharacterService;
use App\Modules\Character\UI\Http\CommandMappers\AttackCharacterCommandMapper;
use App\Modules\Character\UI\Http\CommandMappers\CreateCharacterCommandMapper;
use App\Http\Requests\CreateCharacterRequest;
use App\Http\Requests\UpdateCharacterAttributeRequest;
use App\Modules\Character\UI\Http\CommandMappers\IncreaseAttributeCommandMapper;
use App\Modules\Character\UI\Http\CommandMappers\MoveCharacterCommandMapper;
use App\Race;
use App\Models\Race;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/CharacterMessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;
use App\Modules\Message\Application\Services\MessageService;
use App\Modules\Message\UI\Http\CommandMappers\SendMessageCommandMapper;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/CharacterStoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/InventoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;
use App\Modules\Equipment\Application\Services\InventoryService;
use App\Modules\Equipment\UI\Http\CommandMappers\EquipItemCommandMapper;
use App\Modules\Level\Application\Services\LevelService;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Location;
use App\Models\Location;

class LocationController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/OwnStoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Character;
use App\Models\Character;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;

Expand Down
12 changes: 6 additions & 6 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
Expand All @@ -36,12 +37,11 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\UpdateLastUserActivity::class,
],

'api' => [
'throttle:60,1',
'bindings',
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

Expand All @@ -53,9 +53,9 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/CanAttack.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Middleware;

use App\Character;
use App\User;
use App\Models\Character;
use App\Models\User;
use Closure;
use Illuminate\Http\Request;

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/CanMoveToLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Http\Middleware;

use App\Character;
use App\Location;
use App\Models\Character;
use App\Models\Location;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/HasCharacter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use App\Models\User;
use Closure;

class HasCharacter
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/IsAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use App\Models\User;
use Closure;

class IsAdmin
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/IsCharacterLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use App\Models\User;
use Closure;

class IsCharacterLocation
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/NoCharacterYet.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use App\Models\User;
use Closure;

class NoCharacterYet
Expand Down
17 changes: 17 additions & 0 deletions app/Http/Middleware/PreventRequestsDuringMaintenance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;

class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}
Loading

0 comments on commit 0437d4e

Please sign in to comment.