diff --git a/README.md b/README.md index 26dc65b..d199a75 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# LDC Web Admin Secure Laravel +# Admin Secure Laravel ## Install on Laravel ``` -composer req ldc/web-admin-secure-laravel +composer req uwil/admin-secure-laravel ``` .env.example : @@ -24,7 +24,7 @@ php artisan schedule:run ## Available Commands ``` -ldcweb:admin-secure-sync +uwil:admin-secure:sync ``` ## Usage Put 'admin-secure' middleware on route to protect it. diff --git a/changelog.md b/changelog.md index 2fa03eb..c9c0d0a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## **Version 3.0.0** + +- Add Laravel 11 compatibility +- Bump deps for Laravel 11 +- Change namespace for UWIL complience + ## **Version 2.0.3** - Add staging to environnements where sync command should be executed diff --git a/composer.json b/composer.json index d730592..cf6ebe9 100644 --- a/composer.json +++ b/composer.json @@ -1,43 +1,44 @@ { - "name": "ldc/web-admin-secure-laravel", + "name": "uwil/admin-secure-laravel", "description": "Restrict access to LDC Network", "license": "MIT", + "version": "3.0.0", "authors": [ { - "name": "Vincent BRIDIER", - "email": "vincent.bridier@ldc.fr", + "name": "Equipe Web", + "email": "equipe.web@ldc.fr", "homepage": "https://www.ldc.fr" } ], "require": { - "php": ">=8.2", - "illuminate/support": "~10", - "laravel/framework": "~10", - "symfony/options-resolver": "^3.4.43|^4.4.30|^5.0.11|^6.0", - "dxw/cidr": "^3.1" + "php": "^8.3", + "illuminate/support": "~11", + "laravel/framework": "~11", + "symfony/options-resolver": "^7.0", + "dxw/cidr": "^3.2" }, "require-dev": { - "phpunit/phpunit": "^9", + "phpunit/phpunit": "^11", "squizlabs/php_codesniffer": "^3", - "orchestra/testbench": "^8", - "slevomat/coding-standard": "^7", - "phpunit/php-code-coverage": "^9", - "larastan/larastan": "^2.6" + "orchestra/testbench": "^9", + "slevomat/coding-standard": "^8", + "phpunit/php-code-coverage": "^11", + "larastan/larastan": "^2.9" }, "autoload": { "psr-4": { - "LDC\\WebAdminSecureLaravel\\": "src/" + "Uwil\\AdminSecure\\Laravel\\": "src/" } }, "autoload-dev": { "psr-4": { - "LDC\\WebAdminSecureLaravel\\Tests\\": "tests" + "Uwil\\AdminSecure\\Laravel\\Tests\\": "tests" } }, "extra": { "laravel": { "providers": [ - "LDC\\WebAdminSecureLaravel\\AdminSecureServiceProvider" + "Uwil\\AdminSecure\\Laravel\\AdminSecureServiceProvider" ] } }, diff --git a/src/AdminSecure.php b/src/AdminSecure.php index 3c1c9b9..f87a18a 100644 --- a/src/AdminSecure.php +++ b/src/AdminSecure.php @@ -1,6 +1,6 @@ - * @throws \LDC\WebAdminSecureLaravel\Exceptions\AdminSecureException If Wrong env value. + * @throws \Uwil\AdminSecure\Laravel\Exceptions\AdminSecureException If Wrong env value. * @throws \Illuminate\Http\Client\RequestException If calling admin secure fails. * @phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.WrongNumber */ @@ -192,7 +192,7 @@ abstract class AdminSecure * * @param array $ip_list * @return void - * @throws \LDC\WebAdminSecureLaravel\Exceptions\AdminSecureInvalidAdressException If an IP is invalid. + * @throws \Uwil\AdminSecure\Laravel\Exceptions\AdminSecureInvalidAdressException If an IP is invalid. */ private static function validateIpList(array $ip_list): void { @@ -218,7 +218,7 @@ abstract class AdminSecure /** * Get Admin secure options * - * @return \LDC\WebAdminSecureLaravel\Options + * @return \Uwil\AdminSecure\Laravel\Options */ public static function getOptions(): Options { diff --git a/src/AdminSecureServiceProvider.php b/src/AdminSecureServiceProvider.php index 112b10f..4089c37 100644 --- a/src/AdminSecureServiceProvider.php +++ b/src/AdminSecureServiceProvider.php @@ -1,13 +1,13 @@ commands([SyncFromLDCWeb::class]); + $this->commands([SyncFromLdcWeb::class]); // * Set filter condition $this->app->singleton('hasToFilterIp', fn (Application $app) => $app->environment('production', 'staging')); @@ -33,7 +33,7 @@ class AdminSecureServiceProvider extends ServiceProvider if ($this->app->make('hasToFilterIp')) { /** @var \Illuminate\Console\Scheduling\Schedule */ $schedule = $this->app->make(Schedule::class); - $schedule->command('ldcweb:admin-secure-sync')->daily(); + $schedule->command('uwil:admin-secure:sync')->daily(); } }); diff --git a/src/Console/SyncFromLDCWeb.php b/src/Console/SyncFromLdcWeb.php similarity index 69% rename from src/Console/SyncFromLDCWeb.php rename to src/Console/SyncFromLdcWeb.php index 7a0d7b7..d9f6366 100644 --- a/src/Console/SyncFromLDCWeb.php +++ b/src/Console/SyncFromLdcWeb.php @@ -1,23 +1,23 @@ */ -class SyncFromLDCWeb extends Command +class SyncFromLdcWeb extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'ldcweb:admin-secure-sync'; + protected $signature = 'uwil:admin-secure:sync'; /** * The console command description. @@ -30,7 +30,7 @@ class SyncFromLDCWeb extends Command * Execute the console command. * * @return integer - * @throws \LDC\WebAdminSecureLaravel\Exceptions\AdminSecureException If missing LDC_WEB_API_KEY key. + * @throws \Uwil\AdminSecure\Laravel\Exceptions\AdminSecureException If missing LDC_WEB_API_KEY key. */ public function handle(): int { diff --git a/src/Exceptions/AdminSecureException.php b/src/Exceptions/AdminSecureException.php index 10a92a1..87afeea 100644 --- a/src/Exceptions/AdminSecureException.php +++ b/src/Exceptions/AdminSecureException.php @@ -1,6 +1,6 @@