diff --git a/app/Console/Commands/SetupApplication.php b/app/Console/Commands/SetupApplication.php index 8455434..d85be3e 100644 --- a/app/Console/Commands/SetupApplication.php +++ b/app/Console/Commands/SetupApplication.php @@ -40,6 +40,7 @@ public function handle(): void $this->migrate(); $this->cacheConfig(); $this->scout(); + $this->cloudflare(); } } @@ -108,4 +109,14 @@ protected function scout(): void { $this->artisan('✓ Setup scout', 'scout:setup', ['--force' => true]); } + + /** + * Reload cloudflare ips. + */ + protected function cloudflare(): void + { + if ((bool) config('laravelcloudflare.enabled')) { + $this->artisan('✓ Reload cloudflare ips', 'cloudflare:reload'); + } + } } diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 4c1dd5a..86a5b30 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -12,7 +12,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule): void { - // $schedule->command('inspire')->hourly(); + $schedule->command('cloudflare:reload')->daily(); } /** diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 9883120..e5e8ae3 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -12,6 +12,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Validation\Rule; +use Pirsch\Facades\Pirsch; class RegisteredUserController extends Controller { @@ -32,6 +33,10 @@ public function create(): View */ public function store(Request $request): RedirectResponse { + Pirsch::track('Action', [ + 'Label' => 'register', + ]); + $request->validate([ 'email' => [ 'required', diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 05df454..ee981da 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,7 +14,7 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ - \App\Http\Middleware\TrustProxies::class, + \Monicahq\Cloudflare\Http\Middleware\TrustProxies::class, \Illuminate\Http\Middleware\HandleCors::class, \App\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, @@ -35,6 +35,7 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Pirsch\Http\Middleware\TrackPageview::class, ], 'api' => [ diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php deleted file mode 100644 index 3391630..0000000 --- a/app/Http/Middleware/TrustProxies.php +++ /dev/null @@ -1,28 +0,0 @@ -|string|null - */ - protected $proxies; - - /** - * The headers that should be used to detect proxies. - * - * @var int - */ - protected $headers = - Request::HEADER_X_FORWARDED_FOR | - Request::HEADER_X_FORWARDED_HOST | - Request::HEADER_X_FORWARDED_PORT | - Request::HEADER_X_FORWARDED_PROTO | - Request::HEADER_X_FORWARDED_AWS_ELB; -} diff --git a/app/Http/ViewModels/Home/HomeViewModel.php b/app/Http/ViewModels/Home/HomeViewModel.php index 8570a21..e44c4e4 100644 --- a/app/Http/ViewModels/Home/HomeViewModel.php +++ b/app/Http/ViewModels/Home/HomeViewModel.php @@ -103,7 +103,7 @@ public static function adminLists(): Collection ->map(fn (NameList $list) => [ 'id' => $list->id, 'name' => $list->name, - 'total' => Number::format($list->names_count, locale: 'fr'), + 'total' => Number::format($list->names_count), 'names' => $list->names() ->inRandomOrder() ->take(4) diff --git a/composer.json b/composer.json index 7f47cf4..1625fa8 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,10 @@ "laravel/sanctum": "^3.3", "laravel/scout": "^10.6", "laravel/tinker": "^2.8", - "mauricius/laravel-htmx": "^0.5.0", - "openai-php/laravel": "^0.8.0", + "mauricius/laravel-htmx": "^0", + "monicahq/laravel-cloudflare": "^3.5", + "openai-php/laravel": "^0", + "pirsch-analytics/laravel-pirsch": "^0", "spatie/laravel-sitemap": "^7.0", "spatie/simple-excel": "^3.2" }, @@ -60,6 +62,7 @@ "@php artisan package:discover --ansi" ], "post-update-cmd": [ + "Illuminate\\Foundation\\ComposerScripts::postUpdate", "@php artisan vendor:publish --tag=laravel-assets --ansi --force" ] }, diff --git a/composer.lock b/composer.lock index 24ef4e0..97db118 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5bcaf7719eecec7efd2c10b6d7af3f6f", + "content-hash": "871c670d37a3e72f6356eb2d5d3d2c3d", "packages": [ { "name": "blade-ui-kit/blade-heroicons", @@ -2743,6 +2743,82 @@ }, "time": "2023-11-19T11:20:49+00:00" }, + { + "name": "monicahq/laravel-cloudflare", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/monicahq/laravel-cloudflare.git", + "reference": "156f49fa823fbdec4c26691cb83844c9283f14dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/monicahq/laravel-cloudflare/zipball/156f49fa823fbdec4c26691cb83844c9283f14dc", + "reference": "156f49fa823fbdec4c26691cb83844c9283f14dc", + "shasum": "" + }, + "require": { + "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "mockery/mockery": "^1.4", + "nunomaduro/larastan": "^1.0 || ^2.4", + "ocramius/package-versions": "^1.5 || ^2.1", + "orchestra/testbench": "^6.0 || ^7.0 || ^8.0", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^8.0 || ^9.0", + "thecodingmachine/phpstan-safe-rule": "^1.0", + "vimeo/psalm": "^4.0 || ^5.6" + }, + "suggest": { + "guzzlehttp/guzzle": "Required to get cloudflares ip addresses (^6.5.5|^7.0)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Monicahq\\Cloudflare\\TrustedProxyServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Monicahq\\Cloudflare\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexis Saettler", + "email": "alexis@saettler.org" + } + ], + "description": "Add Cloudflare ip addresses to trusted proxies for Laravel.", + "keywords": [ + "cloudflare", + "laravel", + "php", + "proxies" + ], + "support": { + "issues": "https://github.com/monicahq/laravel-cloudflare/issues", + "source": "https://github.com/monicahq/laravel-cloudflare" + }, + "funding": [ + { + "url": "https://github.com/asbiin", + "type": "github" + } + ], + "time": "2023-02-07T18:14:12+00:00" + }, { "name": "monolog/monolog", "version": "3.5.0", @@ -3770,6 +3846,90 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "pirsch-analytics/laravel-pirsch", + "version": "0.4.8", + "source": { + "type": "git", + "url": "https://github.com/pirsch-analytics/laravel-pirsch.git", + "reference": "374532b27311342d847e30e37455e6514c10bab0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pirsch-analytics/laravel-pirsch/zipball/374532b27311342d847e30e37455e6514c10bab0", + "reference": "374532b27311342d847e30e37455e6514c10bab0", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^9.0|^10.0", + "illuminate/http": "^9.0|^10.0", + "php": "^8.1", + "spatie/laravel-package-tools": "^1.9.2" + }, + "require-dev": { + "laravel/pint": "^0.2.2", + "nunomaduro/collision": "^6.0", + "nunomaduro/larastan": "^2.0.1", + "orchestra/testbench": "^7.0", + "pestphp/pest": "^1.21", + "pestphp/pest-plugin-laravel": "^1.1", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5", + "spatie/laravel-ray": "^1.26" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Pirsch\\PirschServiceProvider" + ], + "aliases": { + "Pirsch": "Pirsch\\Facades\\Pirsch" + } + } + }, + "autoload": { + "psr-4": { + "Pirsch\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marvin Blum", + "email": "marvin.blum@emvi.com", + "role": "Developer" + }, + { + "name": "Zep Fietje", + "email": "hey@zepfietje.com", + "role": "Developer" + } + ], + "description": "Official Laravel integration for Pirsch Analytics.", + "homepage": "https://github.com/pirsch-analytics/laravel-pirsch", + "keywords": [ + "laravel", + "laravel-pirsch", + "pirsch-analytics" + ], + "support": { + "issues": "https://github.com/pirsch-analytics/laravel-pirsch/issues", + "source": "https://github.com/pirsch-analytics/laravel-pirsch/tree/0.4.8" + }, + "funding": [ + { + "url": "https://github.com/zepfietje", + "type": "github" + } + ], + "time": "2023-09-22T11:21:59+00:00" + }, { "name": "psr/cache", "version": "3.0.0", @@ -11206,7 +11366,7 @@ "dbrisinajumi/d2files": "<1", "dcat/laravel-admin": "<=2.1.3.0-beta", "derhansen/fe_change_pwd": "<2.0.5|>=3,<3.0.3", - "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1|>=7,<7.4", "desperado/xml-bundle": "<=0.1.7", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", "doctrine/annotations": "<1.2.7", @@ -11221,7 +11381,7 @@ "dolibarr/dolibarr": "<18.0.2", "dompdf/dompdf": "<2.0.4", "doublethreedigital/guest-entries": "<3.1.2", - "drupal/core": "<9.5.11|>=10,<10.0.11|>=10.1,<10.1.4", + "drupal/core": ">=6,<6.38|>=7,<7.96|>=8,<10.1.8|>=10.2,<10.2.2", "drupal/drupal": ">=5,<5.11|>=6,<6.38|>=7,<7.80|>=8,<8.9.16|>=9,<9.1.12|>=9.2,<9.2.4", "duncanmcclean/guest-entries": "<3.1.2", "dweeves/magmi": "<=0.7.24", @@ -11292,7 +11452,7 @@ "funadmin/funadmin": "<=3.2|>=3.3.2,<=3.3.3", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", - "getgrav/grav": "<=1.7.42.1", + "getgrav/grav": "<1.7.44", "getkirby/cms": "<3.5.8.3-dev|>=3.6,<3.6.6.3-dev|>=3.7,<3.7.5.2-dev|>=3.8,<3.8.4.1-dev|>=3.9,<3.9.6", "getkirby/kirby": "<=2.5.12", "getkirby/panel": "<2.5.14", @@ -11387,7 +11547,7 @@ "liftkit/database": "<2.13.2", "limesurvey/limesurvey": "<3.27.19", "livehelperchat/livehelperchat": "<=3.91", - "livewire/livewire": ">2.2.4,<2.2.6|>=3,<3.0.4", + "livewire/livewire": ">2.2.4,<2.2.6", "lms/routes": "<2.1.1", "localizationteam/l10nmgr": "<7.4|>=8,<8.7|>=9,<9.2", "luyadev/yii-helpers": "<1.2.1", @@ -11510,7 +11670,7 @@ "pimcore/ecommerce-framework-bundle": "<1.0.10", "pimcore/perspective-editor": "<1.5.1", "pimcore/pimcore": "<11.1.1", - "pixelfed/pixelfed": "<=0.11.4", + "pixelfed/pixelfed": "<0.11.11", "plotly/plotly.js": "<2.25.2", "pocketmine/bedrock-protocol": "<8.0.2", "pocketmine/pocketmine-mp": "<=4.23|>=5,<5.3.1", @@ -11688,14 +11848,13 @@ "twig/twig": "<1.44.7|>=2,<2.15.3|>=3,<3.4.3", "typo3/cms": "<9.5.29|>=10,<10.4.35|>=11,<11.5.23|>=12,<12.2", "typo3/cms-backend": "<4.1.14|>=4.2,<4.2.15|>=4.3,<4.3.7|>=4.4,<4.4.4|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", - "typo3/cms-core": "<8.7.55|>=9,<9.5.44|>=10,<10.4.41|>=11,<11.5.33|>=12,<12.4.8", + "typo3/cms-core": "<=8.7.56|>=9,<=9.5.45|>=10,<=10.4.42|>=11,<=11.5.34|>=12,<=12.4.10|==13", "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", "typo3/cms-fluid": "<4.3.4|>=4.4,<4.4.1", "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", "typo3/cms-frontend": "<4.3.9|>=4.4,<4.4.5", "typo3/cms-install": "<4.1.14|>=4.2,<4.2.16|>=4.3,<4.3.9|>=4.4,<4.4.5|>=12.2,<12.4.8", "typo3/cms-rte-ckeditor": ">=9.5,<9.5.42|>=10,<10.4.39|>=11,<11.5.30", - "typo3/cms-saltedpasswords": "<0.2.13", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", "typo3/html-sanitizer": ">=1,<=1.5.2|>=2,<=2.1.3", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", @@ -11752,6 +11911,7 @@ "yikesinc/yikes-inc-easy-mailchimp-extender": "<6.8.6", "yoast-seo-for-typo3/yoast_seo": "<7.2.3", "yourls/yourls": "<=1.8.2", + "yuan1994/tpadmin": "<=1.3.12", "zencart/zencart": "<=1.5.7.0-beta", "zendesk/zendesk_api_client_php": "<2.2.11", "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", diff --git a/config/app.php b/config/app.php index 45873c5..5969cdb 100644 --- a/config/app.php +++ b/config/app.php @@ -16,7 +16,7 @@ | */ - 'name' => env('APP_NAME', 'Tous les prénoms'), + 'name' => env('APP_REALNAME', env('APP_NAME', 'Tous les prénoms')), /* |--------------------------------------------------------------------------