Skip to content

Commit 9cceed8

Browse files
authored
Merge pull request #110 from BinaryStudioAcademy/feature/upgrade_laravel_to_6
Upgrade Laravel to 6
2 parents 5242919 + 10d93de commit 9cceed8

Some content is hidden

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

52 files changed

+2828
-1615
lines changed

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MAIL_USERNAME=null
3030
MAIL_PASSWORD=null
3131
MAIL_ENCRYPTION=null
3232
MAIL_FROM_ADDRESS=
33-
MAIL_FROM_NAME=
33+
MAIL_FROM_NAME="${APP_NAME}"
3434

3535
AWS_ACCESS_KEY_ID=
3636
AWS_SECRET_ACCESS_KEY=
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Technologies
44

55
* PHP 7.3
6-
* [Laravel 5.8](https://laravel.com)
6+
* [Laravel 6](https://laravel.com)
77
* [Docker](https://www.docker.com/)
88
* [Docker-compose](https://docs.docker.com/compose/)
99
* [Beanstalkd](https://github.com/beanstalkd/beanstalkd) - message queue (очередь сообщений для обработки тяжелых задач асинхронно)

backend/app/Entity/User.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use Illuminate\Database\Eloquent\Relations\HasMany;
99
use InvalidArgumentException;
1010
use Tymon\JWTAuth\Contracts\JWTSubject;
11-
use Illuminate\Notifications\Notifiable;
1211
use Illuminate\Foundation\Auth\User as Authenticatable;
12+
use Illuminate\Notifications\Notifiable;
1313

1414
/**
1515
* Class User
@@ -88,7 +88,7 @@ public function changeFirstName(string $firstName): void
8888

8989
$this->attributes['first_name'] = $firstName;
9090
}
91-
91+
9292
public function changeLastName(string $lastName): void
9393
{
9494
if (empty($lastName)) {

backend/app/Exceptions/Handler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1010
use Illuminate\Http\JsonResponse;
1111
use Illuminate\Http\Request;
12-
use Illuminate\Http\Response;
1312
use Illuminate\Support\Facades\Config;
1413
use Illuminate\Validation\ValidationException;
14+
use Symfony\Component\HttpFoundation\Response;
1515
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1717
use Illuminate\Auth\Access\AuthorizationException;
@@ -42,6 +42,7 @@ class Handler extends ExceptionHandler
4242
*
4343
* @param Exception $exception
4444
* @return void
45+
*
4546
* @throws Exception
4647
*/
4748
public function report(Exception $exception)
@@ -63,6 +64,8 @@ public function report(Exception $exception)
6364
* @param Request $request
6465
* @param Exception $exception
6566
* @return Response|JsonResponse
67+
*
68+
* @throws Exception
6669
*/
6770
public function render($request, Exception $exception)
6871
{
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Foundation\Auth\ConfirmsPasswords;
8+
9+
class ConfirmPasswordController extends Controller
10+
{
11+
/*
12+
|--------------------------------------------------------------------------
13+
| Confirm Password Controller
14+
|--------------------------------------------------------------------------
15+
|
16+
| This controller is responsible for handling password confirmations and
17+
| uses a simple trait to include the behavior. You're free to explore
18+
| this trait and override any functions that require customization.
19+
|
20+
*/
21+
22+
use ConfirmsPasswords;
23+
24+
/**
25+
* Where to redirect users when the intended url fails.
26+
*
27+
* @var string
28+
*/
29+
protected $redirectTo = RouteServiceProvider::HOME;
30+
31+
/**
32+
* Create a new controller instance.
33+
*
34+
* @return void
35+
*/
36+
public function __construct()
37+
{
38+
$this->middleware('auth');
39+
}
40+
}

backend/app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,4 @@ class ForgotPasswordController extends Controller
1919
*/
2020

2121
use SendsPasswordResetEmails;
22-
23-
/**
24-
* Create a new controller instance.
25-
*
26-
* @return void
27-
*/
28-
public function __construct()
29-
{
30-
$this->middleware('guest');
31-
}
3222
}

backend/app/Http/Controllers/Auth/LoginController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
67
use Illuminate\Foundation\Auth\AuthenticatesUsers;
78

89
class LoginController extends Controller
@@ -25,7 +26,7 @@ class LoginController extends Controller
2526
*
2627
* @var string
2728
*/
28-
protected $redirectTo = '/home';
29+
protected $redirectTo = RouteServiceProvider::HOME;
2930

3031
/**
3132
* Create a new controller instance.

backend/app/Http/Controllers/Auth/RegisterController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
namespace App\Http\Controllers\Auth;
44

5-
use App\User;
5+
use App\Entity\User;
66
use App\Http\Controllers\Controller;
7+
use App\Providers\RouteServiceProvider;
78
use Illuminate\Support\Facades\Hash;
89
use Illuminate\Support\Facades\Validator;
910
use Illuminate\Foundation\Auth\RegistersUsers;
@@ -28,7 +29,7 @@ class RegisterController extends Controller
2829
*
2930
* @var string
3031
*/
31-
protected $redirectTo = '/home';
32+
protected $redirectTo = RouteServiceProvider::HOME;
3233

3334
/**
3435
* Create a new controller instance.
@@ -59,7 +60,7 @@ protected function validator(array $data)
5960
* Create a new user instance after a valid registration.
6061
*
6162
* @param array $data
62-
* @return \App\User
63+
* @return User
6364
*/
6465
protected function create(array $data)
6566
{

backend/app/Http/Controllers/Auth/ResetPasswordController.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
67
use Illuminate\Foundation\Auth\ResetsPasswords;
78

89
class ResetPasswordController extends Controller
@@ -25,15 +26,5 @@ class ResetPasswordController extends Controller
2526
*
2627
* @var string
2728
*/
28-
protected $redirectTo = '/home';
29-
30-
/**
31-
* Create a new controller instance.
32-
*
33-
* @return void
34-
*/
35-
public function __construct()
36-
{
37-
$this->middleware('guest');
38-
}
29+
protected $redirectTo = RouteServiceProvider::HOME;
3930
}

backend/app/Http/Controllers/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace App\Http\Controllers;
44

5+
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
56
use Illuminate\Foundation\Bus\DispatchesJobs;
6-
use Illuminate\Routing\Controller as BaseController;
77
use Illuminate\Foundation\Validation\ValidatesRequests;
8-
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
8+
use Illuminate\Routing\Controller as BaseController;
99

1010
class Controller extends BaseController
1111
{

0 commit comments

Comments
 (0)