Skip to content

Commit

Permalink
fixup! MoonShine v2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jampire committed Dec 16, 2023
1 parent 65828bc commit cade9e5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
use Illuminate\Support\Facades\Route;
use Jampire\MoonshineImpersonate\Http\Controllers\ImpersonateController;
use Jampire\MoonshineImpersonate\Support\Settings;
use MoonShine\Http\Middleware\ChangeLocale;

$middlewares = config_impersonate('routes.middleware');
$middlewares[] = ChangeLocale::class;

Route::controller(ImpersonateController::class)
->name(Settings::ALIAS.'.')
->prefix(config_impersonate('routes.prefix'))
->middleware(config_impersonate('routes.middleware'))
->middleware($middlewares)
->group(function (): void {
Route::get('/enter', 'enter')->name('enter');
Route::post('/enter', 'enter')->name('enter-confirm');
Expand Down
2 changes: 2 additions & 0 deletions src/Enums/State.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Jampire\MoonshineImpersonate\Enums;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Middleware/ImpersonateMiddleware.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Jampire\MoonshineImpersonate\Http\Middleware;

use Illuminate\Http\Request;
Expand Down
2 changes: 2 additions & 0 deletions src/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Jampire\MoonshineImpersonate\Providers;

use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
Expand Down
10 changes: 10 additions & 0 deletions tests/Unit/StrictTypesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

uses()->group('arch', 'strict');

arch('strict')
->expect('Jampire\MoonshineImpersonate')
->toUseStrictTypes()
;

0 comments on commit cade9e5

Please sign in to comment.