feat: Integrate Filament Auth UI Enhancer plugin and configure a custom admin theme for the login page.
This commit is contained in:
parent
70617e681a
commit
7a70ef7d74
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use App\Filament\Support\CheerfulNotification;
|
use App\Filament\Support\CheerfulNotification;
|
||||||
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
|
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
|
||||||
|
use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout;
|
||||||
use Filament\Auth\Http\Responses\Contracts\LoginResponse;
|
use Filament\Auth\Http\Responses\Contracts\LoginResponse;
|
||||||
use Filament\Auth\MultiFactor\Contracts\HasBeforeChallengeHook;
|
use Filament\Auth\MultiFactor\Contracts\HasBeforeChallengeHook;
|
||||||
use Filament\Auth\Pages\Login as FilamentLogin;
|
use Filament\Auth\Pages\Login as FilamentLogin;
|
||||||
@ -21,6 +22,8 @@
|
|||||||
|
|
||||||
class Login extends FilamentLogin
|
class Login extends FilamentLogin
|
||||||
{
|
{
|
||||||
|
use HasCustomLayout;
|
||||||
|
|
||||||
public function getHeading(): string|Htmlable
|
public function getHeading(): string|Htmlable
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
@ -133,7 +136,7 @@ public function authenticate(): ?LoginResponse
|
|||||||
|
|
||||||
CheerfulNotification::success(
|
CheerfulNotification::success(
|
||||||
'Hore! Berhasil Masuk 🎉',
|
'Hore! Berhasil Masuk 🎉',
|
||||||
'Selamat datang kembali, '.$user->name.'! Siap untuk beraksi hari ini? 🚀✨'
|
'Selamat datang kembali, ' . $user->name . '! Siap untuk beraksi hari ini? 🚀✨'
|
||||||
)->send();
|
)->send();
|
||||||
|
|
||||||
return app(LoginResponse::class);
|
return app(LoginResponse::class);
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
namespace App\Providers\Filament;
|
namespace App\Providers\Filament;
|
||||||
|
|
||||||
use App\Filament\Pages\Auth\Login;
|
use App\Filament\Pages\Auth\Login;
|
||||||
|
use DiogoGPinto\AuthUIEnhancer\AuthUIEnhancerPlugin;
|
||||||
use Filament\Http\Middleware\Authenticate;
|
use Filament\Http\Middleware\Authenticate;
|
||||||
use Filament\Http\Middleware\AuthenticateSession;
|
use Filament\Http\Middleware\AuthenticateSession;
|
||||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||||
@ -28,6 +29,7 @@ public function panel(Panel $panel): Panel
|
|||||||
->default()
|
->default()
|
||||||
->id('admin')
|
->id('admin')
|
||||||
->path('admin')
|
->path('admin')
|
||||||
|
->viteTheme('resources/css/filament/admin/theme.css')
|
||||||
->login(Login::class)
|
->login(Login::class)
|
||||||
->colors([
|
->colors([
|
||||||
'primary' => Color::Violet,
|
'primary' => Color::Violet,
|
||||||
@ -55,6 +57,10 @@ public function panel(Panel $panel): Panel
|
|||||||
])
|
])
|
||||||
->authMiddleware([
|
->authMiddleware([
|
||||||
Authenticate::class,
|
Authenticate::class,
|
||||||
|
])
|
||||||
|
->plugins([
|
||||||
|
AuthUIEnhancerPlugin::make()
|
||||||
|
->formPanelPosition('left'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
|
"diogogpinto/filament-auth-ui-enhancer": "^2.0",
|
||||||
"filament/filament": "^4.0",
|
"filament/filament": "^4.0",
|
||||||
"laravel/framework": "^12.0",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/tinker": "^2.10.1"
|
"laravel/tinker": "^2.10.1"
|
||||||
|
|||||||
76
composer.lock
generated
76
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "d06fce5a31d9da3c576b967652ed06de",
|
"content-hash": "28d56c0579aa0bff54a3eda86204b137",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "anourvalar/eloquent-serialize",
|
"name": "anourvalar/eloquent-serialize",
|
||||||
@ -690,6 +690,80 @@
|
|||||||
},
|
},
|
||||||
"time": "2024-07-08T12:26:09+00:00"
|
"time": "2024-07-08T12:26:09+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "diogogpinto/filament-auth-ui-enhancer",
|
||||||
|
"version": "v2.0.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/diogogpinto/filament-auth-ui-enhancer.git",
|
||||||
|
"reference": "dcaf3eb200fa7120987d92d8b8df760ed5dd13df"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/diogogpinto/filament-auth-ui-enhancer/zipball/dcaf3eb200fa7120987d92d8b8df760ed5dd13df",
|
||||||
|
"reference": "dcaf3eb200fa7120987d92d8b8df760ed5dd13df",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"filament/filament": "^4.0 | ^5.0",
|
||||||
|
"php": "^8.2",
|
||||||
|
"spatie/laravel-package-tools": "^1.15"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"laravel/pint": "^1.0",
|
||||||
|
"orchestra/testbench": "^9.0|^10.0",
|
||||||
|
"pestphp/pest": "^3.7",
|
||||||
|
"pestphp/pest-plugin-laravel": "^3.0",
|
||||||
|
"pestphp/pest-plugin-livewire": "^3.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": "2026-01-18T00:13:04+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/inflector",
|
"name": "doctrine/inflector",
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
|
|||||||
2421
package-lock.json
generated
Normal file
2421
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,11 +7,11 @@
|
|||||||
"dev": "vite"
|
"dev": "vite"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/vite": "^4.0.0",
|
"@tailwindcss/vite": "^4.1.18",
|
||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"concurrently": "^9.0.1",
|
"concurrently": "^9.0.1",
|
||||||
"laravel-vite-plugin": "^2.0.0",
|
"laravel-vite-plugin": "^2.0.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.1.18",
|
||||||
"vite": "^7.0.7"
|
"vite": "^7.0.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
resources/css/filament/admin/theme.css
Normal file
6
resources/css/filament/admin/theme.css
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@import '../../../../vendor/filament/filament/resources/css/theme.css';
|
||||||
|
|
||||||
|
@source '../../../../app/Filament/**/*';
|
||||||
|
@source '../../../../resources/views/filament/**/*';
|
||||||
|
|
||||||
|
@source '../../../../vendor/diogogpinto/filament-auth-ui-enhancer/resources/**/*.blade.php';
|
||||||
@ -5,7 +5,7 @@ import tailwindcss from '@tailwindcss/vite';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
laravel({
|
laravel({
|
||||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/admin/theme.css'],
|
||||||
refresh: true,
|
refresh: true,
|
||||||
}),
|
}),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user