diff --git a/app/Actions/Fortify/CreateNewUser.php b/app/Actions/Fortify/CreateNewUser.php index 107cb06..6ac2ae0 100644 --- a/app/Actions/Fortify/CreateNewUser.php +++ b/app/Actions/Fortify/CreateNewUser.php @@ -15,7 +15,7 @@ class CreateNewUser implements CreatesNewUsers /** * Validate and create a newly registered user. * - * @return \App\Models\User + * @return User */ public function create(array $input) { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 2979d75..cf6fbf7 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -2,7 +2,31 @@ namespace App\Http; +use App\Http\Middleware\TrimStrings; +use App\Http\Middleware\Authenticate; +use App\Http\Middleware\TrustProxies; +use App\Http\Middleware\EncryptCookies; +use App\Http\Middleware\VerifyCsrfToken; +use Illuminate\Auth\Middleware\Authorize; +use App\Http\Middleware\ValidateSignature; +use Illuminate\Http\Middleware\HandleCors; +use App\Http\Middleware\HandleInertiaRequests; +use Illuminate\Auth\Middleware\RequirePassword; +use Illuminate\Http\Middleware\SetCacheHeaders; +use Illuminate\Session\Middleware\StartSession; +use App\Http\Middleware\RedirectIfAuthenticated; +use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Foundation\Http\Kernel as HttpKernel; +use Illuminate\Auth\Middleware\EnsureEmailIsVerified; +use Illuminate\Routing\Middleware\SubstituteBindings; +use Illuminate\Session\Middleware\AuthenticateSession; +use Illuminate\View\Middleware\ShareErrorsFromSession; +use App\Http\Middleware\PreventRequestsDuringMaintenance; +use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth; +use Illuminate\Foundation\Http\Middleware\ValidatePostSize; +use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; +use Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets; +use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull; class Kernel extends HttpKernel { @@ -15,12 +39,12 @@ class Kernel extends HttpKernel */ protected $middleware = [ // \App\Http\Middleware\TrustHosts::class, - \App\Http\Middleware\TrustProxies::class, - \Illuminate\Http\Middleware\HandleCors::class, - \App\Http\Middleware\PreventRequestsDuringMaintenance::class, - \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - \App\Http\Middleware\TrimStrings::class, - \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, + TrustProxies::class, + HandleCors::class, + PreventRequestsDuringMaintenance::class, + ValidatePostSize::class, + TrimStrings::class, + ConvertEmptyStringsToNull::class, ]; /** @@ -30,20 +54,20 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'web' => [ - \App\Http\Middleware\EncryptCookies::class, - \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\VerifyCsrfToken::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - \App\Http\Middleware\HandleInertiaRequests::class, - \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class, + EncryptCookies::class, + AddQueuedCookiesToResponse::class, + StartSession::class, + ShareErrorsFromSession::class, + VerifyCsrfToken::class, + SubstituteBindings::class, + HandleInertiaRequests::class, + AddLinkHeadersForPreloadedAssets::class, ], 'api' => [ // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 'throttle:api', - \Illuminate\Routing\Middleware\SubstituteBindings::class, + SubstituteBindings::class, ], ]; @@ -55,15 +79,15 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \App\Http\Middleware\Authenticate::class, - 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::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, - 'signed' => \App\Http\Middleware\ValidateSignature::class, - 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + 'auth' => Authenticate::class, + 'auth.basic' => AuthenticateWithBasicAuth::class, + 'auth.session' => AuthenticateSession::class, + 'cache.headers' => SetCacheHeaders::class, + 'can' => Authorize::class, + 'guest' => RedirectIfAuthenticated::class, + 'password.confirm' => RequirePassword::class, + 'signed' => ValidateSignature::class, + 'throttle' => ThrottleRequests::class, + 'verified' => EnsureEmailIsVerified::class, ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index ccf50f9..fbf631c 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Illuminate\Http\Request; use Illuminate\Auth\Middleware\Authenticate as Middleware; class Authenticate extends Middleware @@ -9,7 +10,7 @@ class Authenticate extends Middleware /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request + * @param Request $request * @param string[] ...$guards * * @return mixed @@ -27,7 +28,7 @@ public function handle($request, \Closure $next, ...$guards) /** * Get the path the user should be redirected to when they are not authenticated. * - * @param \Illuminate\Http\Request $request + * @param Request $request * * @return null|string */ diff --git a/app/Http/Resources/WebhookResource.php b/app/Http/Resources/WebhookResource.php index 9879e5b..fd2c1c8 100644 --- a/app/Http/Resources/WebhookResource.php +++ b/app/Http/Resources/WebhookResource.php @@ -3,6 +3,7 @@ namespace App\Http\Resources; use App\Constants\Status; +use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; class WebhookResource extends JsonResource @@ -10,7 +11,7 @@ class WebhookResource extends JsonResource /** * Transform the resource into an array. * - * @param \Illuminate\Http\Request $request + * @param Request $request * * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable */ diff --git a/config/app.php b/config/app.php index 9322adb..624f769 100644 --- a/config/app.php +++ b/config/app.php @@ -1,6 +1,36 @@ [ // 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, + AuthServiceProvider::class, + BroadcastServiceProvider::class, + BusServiceProvider::class, + CacheServiceProvider::class, + ConsoleSupportServiceProvider::class, + CookieServiceProvider::class, + DatabaseServiceProvider::class, + EncryptionServiceProvider::class, + FilesystemServiceProvider::class, + FoundationServiceProvider::class, + HashServiceProvider::class, + MailServiceProvider::class, + NotificationServiceProvider::class, + PaginationServiceProvider::class, + PipelineServiceProvider::class, + QueueServiceProvider::class, + RedisServiceProvider::class, + PasswordResetServiceProvider::class, + SessionServiceProvider::class, + TranslationServiceProvider::class, + ValidationServiceProvider::class, + ViewServiceProvider::class, // Package Service Providers... // Application Service Providers... - App\Providers\AppServiceProvider::class, + AppServiceProvider::class, App\Providers\AuthServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, - App\Providers\EventServiceProvider::class, - App\Providers\HorizonServiceProvider::class, - App\Providers\RouteServiceProvider::class, - App\Providers\FortifyServiceProvider::class, - App\Providers\JetstreamServiceProvider::class, - - Dyrynda\Database\LaravelEfficientUuidServiceProvider::class, - Bugsnag\BugsnagLaravel\BugsnagServiceProvider::class, + EventServiceProvider::class, + HorizonServiceProvider::class, + RouteServiceProvider::class, + FortifyServiceProvider::class, + JetstreamServiceProvider::class, + + LaravelEfficientUuidServiceProvider::class, + BugsnagServiceProvider::class, ], /* diff --git a/config/auth.php b/config/auth.php index c12119c..bd9af2d 100644 --- a/config/auth.php +++ b/config/auth.php @@ -1,5 +1,7 @@ env('DISABLE_AUTH', false), @@ -64,7 +66,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => User::class, ], // 'users' => [ diff --git a/config/sanctum.php b/config/sanctum.php index 73e320e..d687148 100644 --- a/config/sanctum.php +++ b/config/sanctum.php @@ -1,6 +1,8 @@ [ - 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, - 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, + 'verify_csrf_token' => VerifyCsrfToken::class, + 'encrypt_cookies' => EncryptCookies::class, ], ]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index dbfa4bc..2f5c14e 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -36,7 +36,7 @@ public function definition() /** * Indicate that the model's email address should be unverified. * - * @return \Illuminate\Database\Eloquent\Factories\Factory + * @return Factory */ public function unverified() { diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php index ab92402..824e6ae 100644 --- a/tests/CreatesApplication.php +++ b/tests/CreatesApplication.php @@ -2,6 +2,7 @@ namespace Tests; +use Illuminate\Foundation\Application; use Illuminate\Contracts\Console\Kernel; trait CreatesApplication @@ -9,7 +10,7 @@ trait CreatesApplication /** * Creates the application. * - * @return \Illuminate\Foundation\Application + * @return Application */ public function createApplication() {