From 18ce4083b4c72c7513786055771deee5e40e169e Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@hebeler.club>
Date: Thu, 20 Jul 2023 10:17:18 +0200
Subject: [PATCH] Migrated changed laravel files

---
 metager/.gitignore                            |  1 +
 metager/app/Console/Kernel.php                |  9 +--
 metager/app/Exceptions/Handler.php            | 67 ++++-------------
 metager/app/Http/Controllers/Controller.php   |  5 +-
 metager/app/Http/Kernel.php                   | 10 +--
 metager/app/Http/Middleware/Authenticate.php  | 12 +--
 .../Middleware/RedirectIfAuthenticated.php    | 10 +--
 metager/app/Http/Middleware/TrustHosts.php    |  4 +-
 metager/app/Providers/AppServiceProvider.php  |  8 +-
 metager/app/Providers/AuthServiceProvider.php |  8 +-
 .../Providers/BroadcastServiceProvider.php    |  6 +-
 .../app/Providers/EventServiceProvider.php    |  8 +-
 .../app/Providers/RouteServiceProvider.php    |  6 +-
 metager/app/User.php                          | 34 ++++++---
 metager/config/app.php                        | 71 ++----------------
 metager/config/auth.php                       |  2 +-
 metager/config/broadcasting.php               | 23 ++++--
 metager/config/cache.php                      |  3 +-
 metager/config/logging.php                    | 75 +++++++++++++++++--
 metager/config/mail.php                       | 26 +++++--
 metager/config/queue.php                      | 16 ++++
 ...12_100000_create_password_resets_table.php | 10 +--
 metager/tests/CreatesApplication.php          |  7 +-
 23 files changed, 210 insertions(+), 211 deletions(-)

diff --git a/metager/.gitignore b/metager/.gitignore
index c6ad8312e..fa46788d0 100644
--- a/metager/.gitignore
+++ b/metager/.gitignore
@@ -2,6 +2,7 @@
 /public/storage
 /vendor
 /.idea
+/.phpunit.cache
 Homestead.json
 Homestead.yaml
 .env
diff --git a/metager/app/Console/Kernel.php b/metager/app/Console/Kernel.php
index 340205254..9f9f98be9 100644
--- a/metager/app/Console/Kernel.php
+++ b/metager/app/Console/Kernel.php
@@ -10,11 +10,8 @@ class Kernel extends ConsoleKernel
 {
     /**
      * Define the application's command schedule.
-     *
-     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
-     * @return void
      */
-    protected function schedule(Schedule $schedule)
+    protected function schedule(Schedule $schedule): void
     {
         $schedule->command('heartbeat')->everyMinute();
         $schedule->command('requests:gather')->everyFifteenMinutes();
@@ -35,10 +32,8 @@ class Kernel extends ConsoleKernel
 
     /**
      * Register the Closure based commands for the application.
-     *
-     * @return void
      */
-    protected function commands()
+    protected function commands(): void
     {
         $this->load(__DIR__ . '/Commands');
 
diff --git a/metager/app/Exceptions/Handler.php b/metager/app/Exceptions/Handler.php
index f0c521f35..1489d5b15 100644
--- a/metager/app/Exceptions/Handler.php
+++ b/metager/app/Exceptions/Handler.php
@@ -2,70 +2,29 @@
 
 namespace App\Exceptions;
 
-use Throwable;
-use Illuminate\Auth\AuthenticationException;
 use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
-use Prometheus\CollectorRegistry;
+use Throwable;
 
 class Handler extends ExceptionHandler
 {
     /**
-     * A list of the exception types that should not be reported.
+     * The list of the inputs that are never flashed to the session on validation exceptions.
      *
-     * @var array
+     * @var array<int, string>
      */
-    protected $dontReport = [
-        \Illuminate\Auth\AuthenticationException::class,
-        \Illuminate\Auth\Access\AuthorizationException::class,
-        \Symfony\Component\HttpKernel\Exception\HttpException::class,
-        \Illuminate\Database\Eloquent\ModelNotFoundException::class,
-        \Illuminate\Session\TokenMismatchException::class,
-        \Illuminate\Validation\ValidationException::class,
+    protected $dontFlash = [
+        'current_password',
+        'password',
+        'password_confirmation',
     ];
 
     /**
-     * Report or log an exception.
-     *
-     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
-     *
-     * @param  \Throwable  $exception
-     * @return void
+     * Register the exception handling callbacks for the application.
      */
-    public function report(Throwable $exception)
+    public function register(): void
     {
-        parent::report($exception);
-    }
-
-    /**
-     * Render an exception into an HTTP response.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Throwable  $exception
-     * @return \Illuminate\Http\Response
-     */
-    public function render($request, Throwable $exception)
-    {
-        if ($request->is('*/meta/meta.ger3*')) {
-            $registry = CollectorRegistry::getDefault();
-            $histogram = $registry->getOrRegisterHistogram('metager', 'result_histogram', 'counts total number of returned results', [], [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]);
-            $histogram->observe(0);
-        }
-        return parent::render($request, $exception);
-    }
-
-    /**
-     * Convert an authentication exception into an unauthenticated response.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Illuminate\Auth\AuthenticationException  $exception
-     * @return \Illuminate\Http\Response
-     */
-    protected function unauthenticated($request, AuthenticationException $exception)
-    {
-        if ($request->expectsJson()) {
-            return response()->json(['error' => 'Unauthenticated.'], 401);
-        }
-
-        return redirect()->guest('login');
+        $this->reportable(function (Throwable $e) {
+            //
+        });
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Http/Controllers/Controller.php b/metager/app/Http/Controllers/Controller.php
index a0a2a8a34..46cdcd47a 100644
--- a/metager/app/Http/Controllers/Controller.php
+++ b/metager/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;
+}
\ No newline at end of file
diff --git a/metager/app/Http/Kernel.php b/metager/app/Http/Kernel.php
index 26bc99b53..d06672464 100644
--- a/metager/app/Http/Kernel.php
+++ b/metager/app/Http/Kernel.php
@@ -45,7 +45,7 @@ class Kernel extends HttpKernel
                 ],
 
                 'api' => [
-                        'throttle:api',
+                        \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api',
                         \Illuminate\Routing\Middleware\SubstituteBindings::class,
                 ],
 
@@ -65,13 +65,13 @@ class Kernel extends HttpKernel
         ];
 
         /**
-         * The application's route middleware.
+         * The application's middleware aliases.
          *
-         * These middleware may be assigned to groups or used individually.
+         * Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
          *
-         * @var array
+         * @var array<string, class-string|string>
          */
-        protected $routeMiddleware = [
+        protected $middlewareAliases = [
                 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
                 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
                 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
diff --git a/metager/app/Http/Middleware/Authenticate.php b/metager/app/Http/Middleware/Authenticate.php
index de3dbd461..02c08ed38 100644
--- a/metager/app/Http/Middleware/Authenticate.php
+++ b/metager/app/Http/Middleware/Authenticate.php
@@ -3,19 +3,15 @@
 namespace App\Http\Middleware;
 
 use Illuminate\Auth\Middleware\Authenticate as Middleware;
+use Illuminate\Http\Request;
 
 class Authenticate extends Middleware
 {
     /**
      * Get the path the user should be redirected to when they are not authenticated.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @return string|null
      */
-    protected function redirectTo($request)
+    protected function redirectTo(Request $request): ?string
     {
-        if (!$request->expectsJson()) {
-            return route('login');
-        }
+        return $request->expectsJson() ? null : route('login');
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Http/Middleware/RedirectIfAuthenticated.php b/metager/app/Http/Middleware/RedirectIfAuthenticated.php
index a2813a064..d8b6282c9 100644
--- a/metager/app/Http/Middleware/RedirectIfAuthenticated.php
+++ b/metager/app/Http/Middleware/RedirectIfAuthenticated.php
@@ -6,18 +6,16 @@ use App\Providers\RouteServiceProvider;
 use Closure;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
+use Symfony\Component\HttpFoundation\Response;
 
 class RedirectIfAuthenticated
 {
     /**
      * Handle an incoming request.
      *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
-     * @param  string|null  ...$guards
-     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
+     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
      */
-    public function handle(Request $request, Closure $next, ...$guards)
+    public function handle(Request $request, Closure $next, string...$guards): Response
     {
         $guards = empty($guards) ? [null] : $guards;
 
@@ -29,4 +27,4 @@ class RedirectIfAuthenticated
 
         return $next($request);
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Http/Middleware/TrustHosts.php b/metager/app/Http/Middleware/TrustHosts.php
index 7186414c6..0ca0ed508 100644
--- a/metager/app/Http/Middleware/TrustHosts.php
+++ b/metager/app/Http/Middleware/TrustHosts.php
@@ -11,10 +11,10 @@ class TrustHosts extends Middleware
      *
      * @return array<int, string|null>
      */
-    public function hosts()
+    public function hosts(): array
     {
         return [
             $this->allSubdomainsOfApplicationUrl(),
         ];
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Providers/AppServiceProvider.php b/metager/app/Providers/AppServiceProvider.php
index 59ec1a9c0..2852466ed 100644
--- a/metager/app/Providers/AppServiceProvider.php
+++ b/metager/app/Providers/AppServiceProvider.php
@@ -9,10 +9,8 @@ class AppServiceProvider extends ServiceProvider
 {
     /**
      * Bootstrap any application services.
-     *
-     * @return void
      */
-    public function boot()
+    public function boot(): void
     {
         config(["app.locale" => "default"]);
         $test = app()->getLocale();
@@ -32,10 +30,8 @@ class AppServiceProvider extends ServiceProvider
 
     /**
      * Register any application services.
-     *
-     * @return void
      */
-    public function register()
+    public function register(): void
     {
 
     }
diff --git a/metager/app/Providers/AuthServiceProvider.php b/metager/app/Providers/AuthServiceProvider.php
index 51b351b0b..ae1284618 100644
--- a/metager/app/Providers/AuthServiceProvider.php
+++ b/metager/app/Providers/AuthServiceProvider.php
@@ -13,18 +13,16 @@ class AuthServiceProvider extends ServiceProvider
      * @var array<class-string, class-string>
      */
     protected $policies = [
-        // 'App\Models\Model' => 'App\Policies\ModelPolicy',
+        //
     ];
 
     /**
      * Register any authentication / authorization services.
-     *
-     * @return void
      */
-    public function boot()
+    public function boot(): void
     {
         $this->registerPolicies();
 
         //
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Providers/BroadcastServiceProvider.php b/metager/app/Providers/BroadcastServiceProvider.php
index 395c518bc..16e7cd3a1 100644
--- a/metager/app/Providers/BroadcastServiceProvider.php
+++ b/metager/app/Providers/BroadcastServiceProvider.php
@@ -9,13 +9,11 @@ class BroadcastServiceProvider extends ServiceProvider
 {
     /**
      * Bootstrap any application services.
-     *
-     * @return void
      */
-    public function boot()
+    public function boot(): void
     {
         Broadcast::routes();
 
         require base_path('routes/channels.php');
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/Providers/EventServiceProvider.php b/metager/app/Providers/EventServiceProvider.php
index a1e8289d2..7b5c6c920 100644
--- a/metager/app/Providers/EventServiceProvider.php
+++ b/metager/app/Providers/EventServiceProvider.php
@@ -16,10 +16,8 @@ class EventServiceProvider extends ServiceProvider
 
     /**
      * Register any events for your application.
-     *
-     * @return void
      */
-    public function boot()
+    public function boot(): void
     {
         parent::boot();
 
@@ -28,10 +26,8 @@ class EventServiceProvider extends ServiceProvider
 
     /**
      * Determine if events and listeners should be automatically discovered.
-     *
-     * @return bool
      */
-    public function shouldDiscoverEvents()
+    public function shouldDiscoverEvents(): bool
     {
         return false;
     }
diff --git a/metager/app/Providers/RouteServiceProvider.php b/metager/app/Providers/RouteServiceProvider.php
index abc12e155..5010ffc04 100644
--- a/metager/app/Providers/RouteServiceProvider.php
+++ b/metager/app/Providers/RouteServiceProvider.php
@@ -24,10 +24,8 @@ class RouteServiceProvider extends ServiceProvider
 
     /**
      * Define your route model bindings, pattern filters, etc.
-     *
-     * @return void
      */
-    public function boot()
+    public function boot(): void
     {
         $this->configureRateLimiting();
         parent::boot();
@@ -137,4 +135,4 @@ class RouteServiceProvider extends ServiceProvider
             return Limit::perMinutes(5, 30)->by($request->input("key"));
         });
     }
-}
+}
\ No newline at end of file
diff --git a/metager/app/User.php b/metager/app/User.php
index bfd96a6a2..0af643073 100644
--- a/metager/app/User.php
+++ b/metager/app/User.php
@@ -1,29 +1,45 @@
 <?php
 
-namespace App;
+namespace App\Models;
 
-use Illuminate\Notifications\Notifiable;
+// use Illuminate\Contracts\Auth\MustVerifyEmail;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\Notifiable;
+use Laravel\Sanctum\HasApiTokens;
 
 class User extends Authenticatable
 {
-    use Notifiable;
+    use HasApiTokens, HasFactory, Notifiable;
 
     /**
      * The attributes that are mass assignable.
      *
-     * @var array
+     * @var array<int, string>
      */
     protected $fillable = [
-        'name', 'email', 'password',
+        'name',
+        'email',
+        'password',
     ];
 
     /**
-     * The attributes that should be hidden for arrays.
+     * The attributes that should be hidden for serialization.
      *
-     * @var array
+     * @var array<int, string>
      */
     protected $hidden = [
-        'password', 'remember_token',
+        'password',
+        'remember_token',
+    ];
+
+    /**
+     * The attributes that should be cast.
+     *
+     * @var array<string, string>
+     */
+    protected $casts = [
+        'email_verified_at' => 'datetime',
+        'password' => 'hashed',
     ];
-}
+}
\ No newline at end of file
diff --git a/metager/config/app.php b/metager/config/app.php
index 8ec243034..1f1bc6269 100644
--- a/metager/config/app.php
+++ b/metager/config/app.php
@@ -1,5 +1,7 @@
 <?php
 use App\Providers\SearchSettingsProvider;
+use Illuminate\Support\Facades\Facade;
+use Illuminate\Support\ServiceProvider;
 
 return [
 
@@ -136,40 +138,12 @@ return [
     |
     */
 
-    'providers' => [
-
-            /*
-             * Laravel Framework Service Providers...
-             */
-        Illuminate\Auth\AuthServiceProvider::class,
-        Illuminate\Broadcasting\BroadcastServiceProvider::class,
-        Illuminate\Bus\BusServiceProvider::class,
-        Illuminate\Cache\CacheServiceProvider::class,
-        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
-        Illuminate\Cookie\CookieServiceProvider::class,
-        Illuminate\Database\DatabaseServiceProvider::class,
-        Illuminate\Encryption\EncryptionServiceProvider::class,
-        Illuminate\Filesystem\FilesystemServiceProvider::class,
-        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
-        Illuminate\Hashing\HashServiceProvider::class,
-        Illuminate\Mail\MailServiceProvider::class,
-        Illuminate\Notifications\NotificationServiceProvider::class,
-        Illuminate\Pagination\PaginationServiceProvider::class,
-        Illuminate\Pipeline\PipelineServiceProvider::class,
-        Illuminate\Queue\QueueServiceProvider::class,
-        Illuminate\Redis\RedisServiceProvider::class,
-        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
-        Illuminate\Session\SessionServiceProvider::class,
-        Illuminate\Translation\TranslationServiceProvider::class,
-        Illuminate\Validation\ValidationServiceProvider::class,
-        Illuminate\View\ViewServiceProvider::class,
+    'providers' => ServiceProvider::defaultProviders()->merge([
 
             /*
              * Package Service Providers...
              */
-
             //
-
             /*
              * Application Service Providers...
              */
@@ -184,7 +158,7 @@ return [
         Jenssegers\Agent\AgentServiceProvider::class,
         Mews\Captcha\CaptchaServiceProvider::class,
         SearchSettingsProvider::class,
-    ],
+    ])->toArray(),
 
     /*
     |--------------------------------------------------------------------------
@@ -197,46 +171,13 @@ return [
     |
     */
 
-    'aliases' => [
-
-        'App' => Illuminate\Support\Facades\App::class,
-        'Artisan' => Illuminate\Support\Facades\Artisan::class,
-        'Auth' => Illuminate\Support\Facades\Auth::class,
-        'Blade' => Illuminate\Support\Facades\Blade::class,
-        'Bus' => Illuminate\Support\Facades\Bus::class,
-        'Cache' => Illuminate\Support\Facades\Cache::class,
-        'Config' => Illuminate\Support\Facades\Config::class,
-        'Cookie' => Illuminate\Support\Facades\Cookie::class,
-        'Crypt' => Illuminate\Support\Facades\Crypt::class,
-        'DB' => Illuminate\Support\Facades\DB::class,
-        'Eloquent' => Illuminate\Database\Eloquent\Model::class,
-        'Event' => Illuminate\Support\Facades\Event::class,
-        'File' => Illuminate\Support\Facades\File::class,
-        'Gate' => Illuminate\Support\Facades\Gate::class,
-        'Hash' => Illuminate\Support\Facades\Hash::class,
-        'Http' => Illuminate\Support\Facades\Http::class,
-        'Lang' => Illuminate\Support\Facades\Lang::class,
-        'Log' => Illuminate\Support\Facades\Log::class,
-        'Mail' => Illuminate\Support\Facades\Mail::class,
-        'Notification' => Illuminate\Support\Facades\Notification::class,
-        'Password' => Illuminate\Support\Facades\Password::class,
-        'Queue' => Illuminate\Support\Facades\Queue::class,
-        'Redirect' => Illuminate\Support\Facades\Redirect::class,
+    'aliases' => Facade::defaultAliases()->merge([
         'Redis' => Illuminate\Support\Facades\Redis::class,
-        'Request' => Illuminate\Support\Facades\Request::class,
-        'Response' => Illuminate\Support\Facades\Response::class,
-        'Route' => Illuminate\Support\Facades\Route::class,
-        'Schema' => Illuminate\Support\Facades\Schema::class,
-        'Session' => Illuminate\Support\Facades\Session::class,
-        'Storage' => Illuminate\Support\Facades\Storage::class,
-        'URL' => Illuminate\Support\Facades\URL::class,
-        'Validator' => Illuminate\Support\Facades\Validator::class,
-        'View' => Illuminate\Support\Facades\View::class,
         'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
         'Agent' => Jenssegers\Agent\Facades\Agent::class,
         'Form' => Collective\Html\FormFacade::class,
         'Captcha' => Mews\Captcha\Facades\Captcha::class,
         'Carbon' => Carbon\Carbon::class,
-    ],
+    ])->toArray(),
 
 ];
\ No newline at end of file
diff --git a/metager/config/auth.php b/metager/config/auth.php
index 10c22fc52..ab3571470 100644
--- a/metager/config/auth.php
+++ b/metager/config/auth.php
@@ -94,7 +94,7 @@ return [
     'passwords' => [
         'users' => [
             'provider' => 'users',
-            'table' => 'password_resets',
+            'table' => 'password_reset_tokens',
             'expire' => 60,
         ],
     ],
diff --git a/metager/config/broadcasting.php b/metager/config/broadcasting.php
index 19a59bad9..f03c19f77 100644
--- a/metager/config/broadcasting.php
+++ b/metager/config/broadcasting.php
@@ -11,7 +11,7 @@ return [
     | framework when an event needs to be broadcast. You may set this to
     | any of the connections defined in the "connections" array below.
     |
-    | Supported: "pusher", "redis", "log", "null"
+    | Supported: "pusher", "ably", "redis", "log", "null"
     |
     */
 
@@ -32,12 +32,25 @@ return [
 
         'pusher' => [
             'driver' => 'pusher',
-            'key' => env('PUSHER_KEY'),
-            'secret' => env('PUSHER_SECRET'),
+            'key' => env('PUSHER_APP_KEY'),
+            'secret' => env('PUSHER_APP_SECRET'),
             'app_id' => env('PUSHER_APP_ID'),
             'options' => [
-                //
+                'cluster' => env('PUSHER_APP_CLUSTER'),
+                'host' => env('PUSHER_HOST') ?: 'api-' . env('PUSHER_APP_CLUSTER', 'mt1') . '.pusher.com',
+                'port' => env('PUSHER_PORT', 443),
+                'scheme' => env('PUSHER_SCHEME', 'https'),
+                'encrypted' => true,
+                'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
             ],
+            'client_options' => [
+                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
+            ],
+        ],
+
+        'ably' => [
+            'driver' => 'ably',
+            'key' => env('ABLY_KEY'),
         ],
 
         'redis' => [
@@ -55,4 +68,4 @@ return [
 
     ],
 
-];
+];
\ No newline at end of file
diff --git a/metager/config/cache.php b/metager/config/cache.php
index f3d1d9155..1ddb80724 100644
--- a/metager/config/cache.php
+++ b/metager/config/cache.php
@@ -47,6 +47,7 @@ return [
         'file' => [
             'driver' => 'file',
             'path' => storage_path('framework/cache'),
+            'lock_path' => storage_path('framework/cache/data'),
         ],
 
         'memcached' => [
@@ -88,4 +89,4 @@ return [
 
     'prefix' => 'metager',
 
-];
+];
\ No newline at end of file
diff --git a/metager/config/logging.php b/metager/config/logging.php
index 739c0b6c3..9882c4664 100644
--- a/metager/config/logging.php
+++ b/metager/config/logging.php
@@ -1,6 +1,12 @@
 <?php
+
+use Monolog\Handler\NullHandler;
 use Monolog\Handler\StreamHandler;
+use Monolog\Handler\SyslogUdpHandler;
+use Monolog\Processor\PsrLogMessageProcessor;
+
 return [
+
     /*
     |--------------------------------------------------------------------------
     | Default Log Channel
@@ -11,7 +17,25 @@ return [
     | one of the channels defined in the "channels" configuration array.
     |
     */
+
     'default' => env('LOG_CHANNEL', 'stack'),
+
+    /*
+    |--------------------------------------------------------------------------
+    | Deprecations Log Channel
+    |--------------------------------------------------------------------------
+    |
+    | This option controls the log channel that should be used to log warnings
+    | regarding deprecated PHP and library features. This allows you to get
+    | your application ready for upcoming major versions of dependencies.
+    |
+    */
+
+    'deprecations' => [
+        'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
+        'trace' => false,
+    ],
+
     /*
     |--------------------------------------------------------------------------
     | Log Channels
@@ -26,43 +50,82 @@ return [
     |                    "custom", "stack"
     |
     */
+
     'channels' => [
         'stack' => [
             'driver' => 'stack',
             'channels' => ['single'],
+            'ignore_exceptions' => false,
         ],
+
         'single' => [
             'driver' => 'single',
             'path' => storage_path('logs/laravel.log'),
-            'level' => 'debug',
+            'level' => env('LOG_LEVEL', 'debug'),
+            'replace_placeholders' => true,
         ],
+
         'daily' => [
             'driver' => 'daily',
             'path' => storage_path('logs/laravel.log'),
-            'level' => 'debug',
-            'days' => 7,
+            'level' => env('LOG_LEVEL', 'debug'),
+            'days' => 14,
+            'replace_placeholders' => true,
         ],
+
         'slack' => [
             'driver' => 'slack',
             'url' => env('LOG_SLACK_WEBHOOK_URL'),
             'username' => 'Laravel Log',
             'emoji' => ':boom:',
-            'level' => 'critical',
+            'level' => env('LOG_LEVEL', 'critical'),
+            'replace_placeholders' => true,
         ],
+
+        'papertrail' => [
+            'driver' => 'monolog',
+            'level' => env('LOG_LEVEL', 'debug'),
+            'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
+            'handler_with' => [
+                'host' => env('PAPERTRAIL_URL'),
+                'port' => env('PAPERTRAIL_PORT'),
+                'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'),
+            ],
+            'processors' => [PsrLogMessageProcessor::class],
+        ],
+
         'stderr' => [
             'driver' => 'monolog',
+            'level' => env('LOG_LEVEL', 'debug'),
             'handler' => StreamHandler::class,
+            'formatter' => env('LOG_STDERR_FORMATTER'),
             'with' => [
                 'stream' => 'php://stderr',
             ],
+            'processors' => [PsrLogMessageProcessor::class],
         ],
+
         'syslog' => [
             'driver' => 'syslog',
-            'level' => 'debug',
+            'level' => env('LOG_LEVEL', 'debug'),
+            'facility' => LOG_USER,
+            'replace_placeholders' => true,
         ],
+
         'errorlog' => [
             'driver' => 'errorlog',
-            'level' => 'debug',
+            'level' => env('LOG_LEVEL', 'debug'),
+            'replace_placeholders' => true,
+        ],
+
+        'null' => [
+            'driver' => 'monolog',
+            'handler' => NullHandler::class,
+        ],
+
+        'emergency' => [
+            'path' => storage_path('logs/laravel.log'),
         ],
     ],
+
 ];
\ No newline at end of file
diff --git a/metager/config/mail.php b/metager/config/mail.php
index c144c0bc4..c5ca749ad 100644
--- a/metager/config/mail.php
+++ b/metager/config/mail.php
@@ -28,20 +28,22 @@ return [
     | sending an e-mail. You will specify which one you are using for your
     | mailers below. You are free to add additional mailers as required.
     |
-    | Supported: "smtp", "sendmail", "mailgun", "ses",
-    |            "postmark", "log", "array"
+    | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
+    |            "postmark", "log", "array", "failover"
     |
     */
 
     'mailers' => [
         'smtp' => [
             'transport' => 'smtp',
+            'url' => env('MAIL_URL'),
             'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
             'port' => env('MAIL_PORT', 587),
             'encryption' => env('MAIL_ENCRYPTION', 'tls'),
-            'username' => env('MAIL_USERNAME', "support+46521@metager.de"),
+            'username' => env('MAIL_USERNAME'),
             'password' => env('MAIL_PASSWORD'),
             'timeout' => null,
+            'local_domain' => env('MAIL_EHLO_DOMAIN'),
         ],
 
         'ses' => [
@@ -50,15 +52,21 @@ return [
 
         'mailgun' => [
             'transport' => 'mailgun',
+            // 'client' => [
+            //     'timeout' => 5,
+            // ],
         ],
 
         'postmark' => [
             'transport' => 'postmark',
+            // 'client' => [
+            //     'timeout' => 5,
+            // ],
         ],
 
         'sendmail' => [
             'transport' => 'sendmail',
-            'path' => '/usr/sbin/sendmail -bs',
+            'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
         ],
 
         'log' => [
@@ -69,6 +77,14 @@ return [
         'array' => [
             'transport' => 'array',
         ],
+
+        'failover' => [
+            'transport' => 'failover',
+            'mailers' => [
+                'smtp',
+                'log',
+            ],
+        ],
     ],
 
     /*
@@ -106,4 +122,4 @@ return [
         ],
     ],
 
-];
+];
\ No newline at end of file
diff --git a/metager/config/queue.php b/metager/config/queue.php
index ec2fac3b9..307c48858 100644
--- a/metager/config/queue.php
+++ b/metager/config/queue.php
@@ -55,6 +55,22 @@ return [
             'block_for' => null,
         ],
     ],
+
+    /*
+|--------------------------------------------------------------------------
+| Job Batching
+|--------------------------------------------------------------------------
+|
+| The following options configure the database and table that store job
+| batching information. These options can be updated to any database
+| connection and table which has been defined by your application.
+|
+*/
+
+    'batching' => [
+        'database' => env('DB_CONNECTION', 'mysql'),
+        'table' => 'job_batches',
+    ],
     /*
     |--------------------------------------------------------------------------
     | Failed Queue Jobs
diff --git a/metager/database/migrations/2014_10_12_100000_create_password_resets_table.php b/metager/database/migrations/2014_10_12_100000_create_password_resets_table.php
index bda733dac..836def0ad 100644
--- a/metager/database/migrations/2014_10_12_100000_create_password_resets_table.php
+++ b/metager/database/migrations/2014_10_12_100000_create_password_resets_table.php
@@ -11,9 +11,9 @@ class CreatePasswordResetsTable extends Migration
      *
      * @return void
      */
-    public function up()
+    public function up(): void
     {
-        Schema::create('password_resets', function (Blueprint $table) {
+        Schema::create('password_reset_tokens', function (Blueprint $table) {
             $table->string('email')->index();
             $table->string('token')->index();
             $table->timestamp('created_at')->nullable();
@@ -25,8 +25,8 @@ class CreatePasswordResetsTable extends Migration
      *
      * @return void
      */
-    public function down()
+    public function down(): void
     {
-        Schema::drop('password_resets');
+        Schema::drop('password_reset_tokens');
     }
-}
+}
\ No newline at end of file
diff --git a/metager/tests/CreatesApplication.php b/metager/tests/CreatesApplication.php
index a6028cb88..25b6186d1 100644
--- a/metager/tests/CreatesApplication.php
+++ b/metager/tests/CreatesApplication.php
@@ -2,18 +2,17 @@
 namespace Tests;
 
 use Illuminate\Contracts\Console\Kernel;
+use Illuminate\Foundation\Application;
 
 trait CreatesApplication
 {
     /**
      * Creates the application.
-     *
-     * @return \Illuminate\Foundation\Application
      */
-    public function createApplication()
+    public function createApplication(): Application
     {
         $app = require __DIR__ . '/../bootstrap/app.php';
         $app->make(Kernel::class)->bootstrap();
         return $app;
     }
-}
+}
\ No newline at end of file
-- 
GitLab