Browse Source

Complete Laravel 10 upgrade

Bubka 2 years ago
parent
commit
44c04ebd25

+ 1 - 19
app/Exceptions/Handler.php

@@ -7,25 +7,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 class Handler extends ExceptionHandler
 {
     /**
-     * A list of exception types with their corresponding custom log levels.
-     *
-     * @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
-     */
-    protected $levels = [
-        //
-    ];
-
-    /**
-     * A list of the exception types that are not reported.
-     *
-     * @var array<int, class-string<\Throwable>>
-     */
-    protected $dontReport = [
-        //
-    ];
-
-    /**
-     * A list of the inputs that are never flashed for validation exceptions.
+     * The list of the inputs that are never flashed to the session on validation exceptions.
      *
      * @var array<int, string>
      */

+ 1 - 2
app/Http/Controllers/Controller.php

@@ -3,11 +3,10 @@
 namespace App\Http\Controllers;
 
 use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
-use Illuminate\Foundation\Bus\DispatchesJobs;
 use Illuminate\Foundation\Validation\ValidatesRequests;
 use Illuminate\Routing\Controller as BaseController;
 
 class Controller extends BaseController
 {
-    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
+    use AuthorizesRequests, ValidatesRequests;
 }

+ 2 - 2
app/Http/Kernel.php

@@ -55,7 +55,7 @@ class Kernel extends HttpKernel
         ],
 
         'api.v1' => [
-            'throttle:api',
+            \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
             \Illuminate\Routing\Middleware\SubstituteBindings::class,
             \App\Http\Middleware\KickOutInactiveUser::class,
             \App\Http\Middleware\LogUserLastSeen::class,
@@ -64,7 +64,7 @@ class Kernel extends HttpKernel
     ];
 
     /**
-     * The application's route middleware.
+     * The application's middleware aliases.
      *
      * Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
      *

+ 1 - 0
app/Models/User.php

@@ -69,6 +69,7 @@ class User extends Authenticatable implements WebAuthnAuthenticatable
      */
     protected $casts = [
         'email_verified_at'  => 'datetime',
+        'password'           => 'hashed',
         'is_admin'           => 'boolean',
         'twofaccounts_count' => 'integer',
         'groups_count'       => 'integer',

+ 1 - 0
tests/Unit/UserModelTest.php

@@ -27,6 +27,7 @@ class UserModelTest extends ModelTestCase
             [
                 'id'                 => 'int',
                 'email_verified_at'  => 'datetime',
+                'password'           => 'hashed',
                 'is_admin'           => 'boolean',
                 'twofaccounts_count' => 'integer',
                 'groups_count'       => 'integer',