diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e685c8c..5b51834 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -44,6 +44,10 @@ class AppServiceProvider extends ServiceProvider return $user->isSuperAdmin() ? true : null; }); + Gate::define('viewPulse', function (User $user) { + return $user->isSuperAdmin() ? true : null; + }); + // FilamentAsset::register([ // Js::make('chart-js-plugins', Vite::asset('resources/js/filament-chart-js-plugins.js'))->module(), // ]); diff --git a/composer.json b/composer.json index f6ac7fa..2bc9d9b 100644 --- a/composer.json +++ b/composer.json @@ -9,13 +9,16 @@ "php": "^8.2", "alperenersoy/filament-export": "^3.0", "althinect/filament-spatie-roles-permissions": "^2.3", + "diogogpinto/filament-auth-ui-enhancer": "^1.0", "erag/laravel-pwa": "^1.9", "filament/filament": "^3.3", "intervention/image": "^3.11", "irazasyed/telegram-bot-sdk": "^3.15", "laravel/framework": "^11.31", + "laravel/pulse": "^1.7", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", + "league/flysystem-ftp": "^3.31", "league/flysystem-sftp-v3": "^3.30", "livewire/livewire": "^3.6", "maatwebsite/excel": "^3.1", diff --git a/composer.lock b/composer.lock index 1dcccf5..4f404d1 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": "70aec54c03a23cfc92e7f22d912a2e21", + "content-hash": "6d34b40971a86af610ab889a926f224c", "packages": [ { "name": "alperenersoy/filament-export", @@ -987,6 +987,85 @@ }, "time": "2024-07-08T12:26:09+00:00" }, + { + "name": "diogogpinto/filament-auth-ui-enhancer", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/diogogpinto/filament-auth-ui-enhancer.git", + "reference": "9df96c389b823f987e90455f59f9904e60fcc590" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/diogogpinto/filament-auth-ui-enhancer/zipball/9df96c389b823f987e90455f59f9904e60fcc590", + "reference": "9df96c389b823f987e90455f59f9904e60fcc590", + "shasum": "" + }, + "require": { + "filament/filament": "^3.0", + "php": "^8.1", + "spatie/laravel-package-tools": "^1.15.0" + }, + "require-dev": { + "laravel/pint": "^1.0", + "nunomaduro/collision": "^7.9", + "nunomaduro/larastan": "^2.0.1", + "orchestra/testbench": "^8.0", + "pestphp/pest": "^2.1", + "pestphp/pest-plugin-arch": "^2.0", + "pestphp/pest-plugin-laravel": "^2.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "AuthUIEnhancer": "DiogoGPinto\\AuthUIEnhancer\\Facades\\AuthUIEnhancer" + }, + "providers": [ + "DiogoGPinto\\AuthUIEnhancer\\AuthUIEnhancerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "DiogoGPinto\\AuthUIEnhancer\\": "src/", + "DiogoGPinto\\AuthUIEnhancer\\Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Diogo Pinto", + "role": "Developer" + } + ], + "description": "This Filament plugin empowers you to transform your auth pages with ease, allowing you to make them truly stand out. It offers a flexible alternative to the default auth pages in the Filament Panels package.", + "homepage": "https://github.com/diogogpinto/filament-auth-ui-enhancer", + "keywords": [ + "diogogpinto", + "filament", + "filament-auth-ui-enhancer", + "filament-plugin", + "laravel" + ], + "support": { + "issues": "https://github.com/diogogpinto/filament-auth-ui-enhancer/issues", + "source": "https://github.com/diogogpinto/filament-auth-ui-enhancer" + }, + "funding": [ + { + "url": "https://github.com/diogogpinto", + "type": "github" + } + ], + "time": "2025-03-17T14:07:54+00:00" + }, { "name": "doctrine/dbal", "version": "4.3.4", @@ -1308,6 +1387,61 @@ ], "time": "2024-02-05T11:56:58+00:00" }, + { + "name": "doctrine/sql-formatter", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/sql-formatter.git", + "reference": "9563949f5cd3bd12a17d12fb980528bc141c5806" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/sql-formatter/zipball/9563949f5cd3bd12a17d12fb980528bc141c5806", + "reference": "9563949f5cd3bd12a17d12fb980528bc141c5806", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^14", + "ergebnis/phpunit-slow-test-detector": "^2.20", + "phpstan/phpstan": "^2.1.31", + "phpunit/phpunit": "^10.5.58" + }, + "bin": [ + "bin/sql-formatter" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\SqlFormatter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jeremy Dorn", + "email": "jeremy@jeremydorn.com", + "homepage": "https://jeremydorn.com/" + } + ], + "description": "a PHP SQL highlighting library", + "homepage": "https://github.com/doctrine/sql-formatter/", + "keywords": [ + "highlight", + "sql" + ], + "support": { + "issues": "https://github.com/doctrine/sql-formatter/issues", + "source": "https://github.com/doctrine/sql-formatter/tree/1.5.4" + }, + "time": "2026-02-08T16:21:46+00:00" + }, { "name": "dompdf/dompdf", "version": "v3.1.4", @@ -3337,6 +3471,94 @@ }, "time": "2025-09-19T13:47:56+00:00" }, + { + "name": "laravel/pulse", + "version": "v1.7.3", + "source": { + "type": "git", + "url": "https://github.com/laravel/pulse.git", + "reference": "dfd3b8e98cd1ada8d105e528da0afe1bbfe7d990" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pulse/zipball/dfd3b8e98cd1ada8d105e528da0afe1bbfe7d990", + "reference": "dfd3b8e98cd1ada8d105e528da0afe1bbfe7d990", + "shasum": "" + }, + "require": { + "doctrine/sql-formatter": "^1.4.1", + "guzzlehttp/promises": "^1.0|^2.0", + "illuminate/auth": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/cache": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/config": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/console": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/contracts": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/database": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/events": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/http": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/queue": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/redis": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/routing": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/support": "^10.48.4|^11.0.8|^12.0|^13.0", + "illuminate/view": "^10.48.4|^11.0.8|^12.0|^13.0", + "laravel/sentinel": "^1.0", + "livewire/livewire": "^3.6.4|^4.0", + "nesbot/carbon": "^2.67|^3.0", + "php": "^8.1", + "symfony/console": "^6.0|^7.0|^8.0" + }, + "conflict": { + "nunomaduro/collision": "<7.7.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^7.7", + "mockery/mockery": "^1.0", + "orchestra/testbench": "^8.36|^9.15|^10.8|^11.0", + "pestphp/pest": "^2.0|^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^2.2|^3.0|^4.0", + "phpstan/phpstan": "^1.12.21", + "predis/predis": "^1.0|^2.0" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "Pulse": "Laravel\\Pulse\\Facades\\Pulse" + }, + "providers": [ + "Laravel\\Pulse\\PulseServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Pulse\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.", + "homepage": "https://github.com/laravel/pulse", + "keywords": [ + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/pulse/issues", + "source": "https://github.com/laravel/pulse" + }, + "time": "2026-03-26T14:27:31+00:00" + }, { "name": "laravel/sanctum", "version": "v4.2.0", @@ -3401,6 +3623,62 @@ }, "time": "2025-07-09T19:45:24+00:00" }, + { + "name": "laravel/sentinel", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/sentinel.git", + "reference": "972d9885d9d14312a118e9565c4e6ecc5e751ea1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sentinel/zipball/972d9885d9d14312a118e9565c4e6ecc5e751ea1", + "reference": "972d9885d9d14312a118e9565c4e6ecc5e751ea1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/container": "^8.37|^9.0|^10.0|^11.0|^12.0|^13.0", + "php": "^8.0" + }, + "require-dev": { + "laravel/pint": "^1.27", + "orchestra/testbench": "^6.47.1|^7.56|^8.37|^9.16|^10.9|^11.0", + "phpstan/phpstan": "^2.1.33" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sentinel\\SentinelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sentinel\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Mior Muhammad Zaki", + "email": "mior@laravel.com" + } + ], + "support": { + "source": "https://github.com/laravel/sentinel/tree/v1.1.0" + }, + "time": "2026-03-24T14:03:38+00:00" + }, { "name": "laravel/serializable-closure", "version": "v2.0.6", @@ -3950,6 +4228,56 @@ }, "time": "2025-11-10T17:13:11+00:00" }, + { + "name": "league/flysystem-ftp", + "version": "3.31.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-ftp.git", + "reference": "cd6ab064a695bc340e3090c360021d26cd417e67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-ftp/zipball/cd6ab064a695bc340e3090c360021d26cd417e67", + "reference": "cd6ab064a695bc340e3090c360021d26cd417e67", + "shasum": "" + }, + "require": { + "ext-ftp": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Ftp\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "FTP filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "ftp", + "ftpd" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-ftp/tree/3.31.0" + }, + "time": "2026-01-23T15:30:45+00:00" + }, { "name": "league/flysystem-local", "version": "3.30.2", diff --git a/database/migrations/2026_04_13_180107_create_pulse_tables.php b/database/migrations/2026_04_13_180107_create_pulse_tables.php new file mode 100644 index 0000000..5d194e2 --- /dev/null +++ b/database/migrations/2026_04_13_180107_create_pulse_tables.php @@ -0,0 +1,84 @@ +shouldRun()) { + return; + } + + Schema::create('pulse_values', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('timestamp'); + $table->string('type'); + $table->mediumText('key'); + match ($this->driver()) { + 'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'), + 'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'), + 'sqlite' => $table->string('key_hash'), + }; + $table->mediumText('value'); + + $table->index('timestamp'); // For trimming... + $table->index('type'); // For fast lookups and purging... + $table->unique(['type', 'key_hash']); // For data integrity and upserts... + }); + + Schema::create('pulse_entries', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('timestamp'); + $table->string('type'); + $table->mediumText('key'); + match ($this->driver()) { + 'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'), + 'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'), + 'sqlite' => $table->string('key_hash'), + }; + $table->bigInteger('value')->nullable(); + + $table->index('timestamp'); // For trimming... + $table->index('type'); // For purging... + $table->index('key_hash'); // For mapping... + $table->index(['timestamp', 'type', 'key_hash', 'value']); // For aggregate queries... + }); + + Schema::create('pulse_aggregates', function (Blueprint $table) { + $table->id(); + $table->unsignedInteger('bucket'); + $table->unsignedMediumInteger('period'); + $table->string('type'); + $table->mediumText('key'); + match ($this->driver()) { + 'mariadb', 'mysql' => $table->char('key_hash', 16)->charset('binary')->virtualAs('unhex(md5(`key`))'), + 'pgsql' => $table->uuid('key_hash')->storedAs('md5("key")::uuid'), + 'sqlite' => $table->string('key_hash'), + }; + $table->string('aggregate'); + $table->decimal('value', 20, 2); + $table->unsignedInteger('count')->nullable(); + + $table->unique(['bucket', 'period', 'type', 'aggregate', 'key_hash']); // Force "on duplicate update"... + $table->index(['period', 'bucket']); // For trimming... + $table->index('type'); // For purging... + $table->index(['period', 'type', 'aggregate', 'bucket']); // For aggregate queries... + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('pulse_values'); + Schema::dropIfExists('pulse_entries'); + Schema::dropIfExists('pulse_aggregates'); + } +};