basic install

This commit is contained in:
salam committed 2025-08-14 10:26:40 +02:00
1 parent e68b1f162d
commit b004742d47
13 files changed
+169 -35

No files matched your search

+24 -25
View File
@@ -2,16 +2,18 @@
namespace App\Providers\Filament; namespace App\Providers\Filament;
use Awcodes\LightSwitch\Enums\Alignment;
use Awcodes\LightSwitch\LightSwitchPlugin;
use Filament\Actions\Action; use Filament\Actions\Action;
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;
use Filament\Http\Middleware\DispatchServingFilamentEvent; use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Navigation\NavigationItem;
use Filament\Pages\Dashboard; use Filament\Pages\Dashboard;
use Filament\Panel; use Filament\Panel;
use Filament\PanelProvider; use Filament\PanelProvider;
use Filament\Support\Colors\Color; use Filament\Support\Colors\Color;
use Filament\Support\Enums\Width;
use Filament\Widgets\AccountWidget; use Filament\Widgets\AccountWidget;
use Filament\Widgets\FilamentInfoWidget; use Filament\Widgets\FilamentInfoWidget;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
@@ -19,6 +21,7 @@ use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\StartSession; use Illuminate\Session\Middleware\StartSession;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\Middleware\ShareErrorsFromSession; use Illuminate\View\Middleware\ShareErrorsFromSession;
use Joaopaulolndev\FilamentEditProfile\FilamentEditProfilePlugin; use Joaopaulolndev\FilamentEditProfile\FilamentEditProfilePlugin;
use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage; use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
@@ -30,31 +33,36 @@ class AdminPanelProvider extends PanelProvider
return $panel return $panel
->default() ->default()
->id('admin') ->id('admin')
->path('admin') ->path('')
->login() ->login()
->passwordReset()
->brandLogo(asset('images/nuh.svg'))
->darkModeBrandLogo(asset('images/nuh-d.svg'))
->favicon(asset('images/nuh.svg'))
->brandLogoHeight('1.8rem')
->unsavedChangesAlerts()
->colors([ ->colors([
'primary' => Color::Amber, 'primary' => Color::Slate,
]) ])
->viteTheme('resources/css/filament/admin/theme.css')
->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources') ->discoverResources(in: app_path('Filament/Resources'), for: 'App\Filament\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\Filament\Pages')
->pages([ ->pages([
Dashboard::class, Dashboard::class,
]) ])
->maxContentWidth(Width::ScreenTwoExtraLarge)
->breadcrumbs(false)
->topNavigation()
->userMenuItems([
'profile' => Action::make('profile')
->label(fn () => Auth::user()->name)
->url(fn (): string => EditProfilePage::getUrl())
->icon('heroicon-m-user-circle'),
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets') ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\Filament\Widgets')
->widgets([ ->widgets([
AccountWidget::class, AccountWidget::class,
FilamentInfoWidget::class, FilamentInfoWidget::class,
])->navigationItems([
NavigationItem::make('Analytics')
->url('https://filament.pirsch.io', shouldOpenInNewTab: true)
->icon('heroicon-o-presentation-chart-line')
->group('Reports')
->sort(3),
NavigationItem::make('dashboard')
->label(fn (): string => __('filament-panels::pages/dashboard.title'))
->url(fn (): string => Dashboard::getUrl())
->isActiveWhen(fn () => original_request()->routeIs('filament.admin.pages.dashboard')),
// ...
]) ])
->middleware([ ->middleware([
EncryptCookies::class, EncryptCookies::class,
@@ -70,17 +78,8 @@ class AdminPanelProvider extends PanelProvider
->authMiddleware([ ->authMiddleware([
Authenticate::class, Authenticate::class,
])->plugins([ ])->plugins([
FilamentEditProfilePlugin::make() FilamentEditProfilePlugin::make()->shouldRegisterNavigation(false),
->userMenuItems([ LightSwitchPlugin::make()->position(Alignment::BottomCenter),
'profile' => Action::make('profile')
->label(fn () => auth()->user()->name)
->url(fn (): string => EditProfilePage::getUrl())
->icon('heroicon-m-user-circle')
// If you are using tenancy need to check with the visible method where ->company() is the relation between the user and tenancy model as you called
->visible(function (): bool {
return auth()->user()->company()->exists();
}),
]),
]); ]);
} }
} }
+1
View File
@@ -7,6 +7,7 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.2", "php": "^8.2",
"awcodes/light-switch": "^2.0",
"bezhansalleh/filament-shield": "^v4.0.0-beta2", "bezhansalleh/filament-shield": "^v4.0.0-beta2",
"filament/filament": "^4.0", "filament/filament": "^4.0",
"joaopaulolndev/filament-edit-profile": "^2.0", "joaopaulolndev/filament-edit-profile": "^2.0",
Generated
+74 -1
View File
@@ -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": "bdb8d4ab7ba25aa7dcfa1ce740c728d1", "content-hash": "442b2905594dbc3ebef8325604a8c72e",
"packages": [ "packages": [
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@@ -72,6 +72,79 @@
}, },
"time": "2025-07-30T15:45:57+00:00" "time": "2025-07-30T15:45:57+00:00"
}, },
{
"name": "awcodes/light-switch",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/awcodes/light-switch.git",
"reference": "c5eb8cb9ca26dcaa38d49e0e8fe6f85994326d74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/awcodes/light-switch/zipball/c5eb8cb9ca26dcaa38d49e0e8fe6f85994326d74",
"reference": "c5eb8cb9ca26dcaa38d49e0e8fe6f85994326d74",
"shasum": ""
},
"require": {
"filament/filament": "^4.0",
"php": "^8.2",
"spatie/laravel-package-tools": "^1.15.0"
},
"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",
"rector/rector": "^2.0",
"spatie/laravel-ray": "^1.29"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Awcodes\\LightSwitch\\LightSwitchServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Awcodes\\LightSwitch\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Adam Weston",
"email": "awcodes1@gmail.com",
"role": "Developer"
}
],
"description": "Plugin to add theme switching (light/dark/system) to the auth pages for Filament Panels",
"homepage": "https://github.com/awcodes/light-switch",
"keywords": [
"awcodes",
"filament",
"laravel",
"light-switch",
"plugin"
],
"support": {
"issues": "https://github.com/awcodes/light-switch/issues",
"source": "https://github.com/awcodes/light-switch"
},
"funding": [
{
"url": "https://github.com/awcodes",
"type": "github"
}
],
"time": "2025-08-12T15:52:00+00:00"
},
{ {
"name": "bezhansalleh/filament-shield", "name": "bezhansalleh/filament-shield",
"version": "4.0.0-beta2", "version": "4.0.0-beta2",
+2 -2
View File
@@ -5,11 +5,11 @@
"packages": { "packages": {
"": { "": {
"devDependencies": { "devDependencies": {
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.1.11",
"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.11",
"vite": "^7.0.4" "vite": "^7.0.4"
} }
}, },
+2 -2
View File
@@ -7,11 +7,11 @@
"dev": "vite" "dev": "vite"
}, },
"devDependencies": { "devDependencies": {
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.1.11",
"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.11",
"vite": "^7.0.4" "vite": "^7.0.4"
} }
} }
+5
View File
@@ -0,0 +1,5 @@
<svg fill="#fff" viewBox="0 0 654 410" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path id="N" d="M117,0L0,0L0,410L71,410L71,51L123,51L123,410L194,410L194,51L117,0Z" />
<path id="U" d="M218,0L218,410L336,410L412,359L412,0L342,0L341,359L289,359L290,0L218,0Z" />
<path id="H" d="M436,0L436,410L507,410L508,230L559,229L559,410L630,410L630,0L559,0L559,179L507,179L507,0L436,0Z" />
</svg>

After

Width:  |  Height:  |  Size: 581 B

+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="#fff" viewBox="0 0 1668 410" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path id="N" d="M117,0L0,0L0,410L71,410L71,51L123,51L123,410L194,410L194,51L117,0Z" />
<path id="U" d="M218,0L218,410L336,410L412,359L412,0L342,0L341,359L289,359L290,0L218,0Z" />
<path id="H" d="M436,0L436,410L507,410L508,230L559,229L559,410L630,410L630,0L559,0L559,179L507,179L507,0L436,0Z" />
<rect x="669" y="180" width="114" height="49" />
<path id="O" d="M896,0L819,51L819,358L896,410L937,410L1014,359L1014,51L938,0L896,0ZM943,51L890,51L890,359L943,359L943,51Z" />
<path id="D" d="M1038,0L1155,0L1231,50L1231,359L1156,410L1038,410L1038,0ZM1160,51L1109,51L1109,359L1160,359L1160,51Z" />
<path id="D2" d="M1256,0L1374,0L1450,50L1450,359L1374,410L1256,410L1256,0ZM1378,51L1327,51L1327,359L1378,359L1378,51Z" />
<path id="S" d="M1549,0L1667,0L1667,128L1596,128L1596,51L1545,51L1545,179L1667,179L1667,359L1591,410L1473,410L1473,282L1544,282L1544,359L1596,359L1596,230L1473,230L1473,50L1549,0Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="currentColor" viewBox="0 0 1668 410" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path id="N" d="M117,0L0,0L0,410L71,410L71,51L123,51L123,410L194,410L194,51L117,0Z" />
<path id="U" d="M218,0L218,410L336,410L412,359L412,0L342,0L341,359L289,359L290,0L218,0Z" />
<path id="H" d="M436,0L436,410L507,410L508,230L559,229L559,410L630,410L630,0L559,0L559,179L507,179L507,0L436,0Z" />
<rect x="669" y="180" width="114" height="49" />
<path id="O" d="M896,0L819,51L819,358L896,410L937,410L1014,359L1014,51L938,0L896,0ZM943,51L890,51L890,359L943,359L943,51Z" />
<path id="D" d="M1038,0L1155,0L1231,50L1231,359L1156,410L1038,410L1038,0ZM1160,51L1109,51L1109,359L1160,359L1160,51Z" />
<path id="D2" d="M1256,0L1374,0L1450,50L1450,359L1374,410L1256,410L1256,0ZM1378,51L1327,51L1327,359L1378,359L1378,51Z" />
<path id="S" d="M1549,0L1667,0L1667,128L1596,128L1596,51L1545,51L1545,179L1667,179L1667,359L1591,410L1473,410L1473,282L1544,282L1544,359L1596,359L1596,230L1473,230L1473,50L1549,0Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+5
View File
@@ -0,0 +1,5 @@
<svg fill="currentColor" viewBox="0 0 654 410" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path id="N" d="M117,0L0,0L0,410L71,410L71,51L123,51L123,410L194,410L194,51L117,0Z" />
<path id="U" d="M218,0L218,410L336,410L412,359L412,0L342,0L341,359L289,359L290,0L218,0Z" />
<path id="H" d="M436,0L436,410L507,410L508,230L559,229L559,410L630,410L630,0L559,0L559,179L507,179L507,0L436,0Z" />
</svg>

After

Width:  |  Height:  |  Size: 589 B

+5
View File
@@ -0,0 +1,5 @@
@import '../../../../vendor/filament/filament/resources/css/theme.css';
@source '../../../../app/Filament/**/*';
@source '../../../../resources/views/filament/**/*';
@source '../../../../vendor/awcodes/light-switch/resources/**/*.blade.php';
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="currentColor" viewBox="0 0 1668 410" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path id="N" d="M117,0L0,0L0,410L71,410L71,51L123,51L123,410L194,410L194,51L117,0Z" />
<path id="U" d="M218,0L218,410L336,410L412,359L412,0L342,0L341,359L289,359L290,0L218,0Z" />
<path id="H" d="M436,0L436,410L507,410L508,230L559,229L559,410L630,410L630,0L559,0L559,179L507,179L507,0L436,0Z" />
<rect x="669" y="180" width="114" height="49" />
<path id="O" d="M896,0L819,51L819,358L896,410L937,410L1014,359L1014,51L938,0L896,0ZM943,51L890,51L890,359L943,359L943,51Z" />
<path id="D" d="M1038,0L1155,0L1231,50L1231,359L1156,410L1038,410L1038,0ZM1160,51L1109,51L1109,359L1160,359L1160,51Z" />
<path id="D2" d="M1256,0L1374,0L1450,50L1450,359L1374,410L1256,410L1256,0ZM1378,51L1327,51L1327,359L1378,359L1378,51Z" />
<path id="S" d="M1549,0L1667,0L1667,128L1596,128L1596,51L1545,51L1545,179L1667,179L1667,359L1591,410L1473,410L1473,282L1544,282L1544,359L1596,359L1596,230L1473,230L1473,50L1549,0Z" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

+4 -4
View File
@@ -1,7 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Route; // use Illuminate\Support\Facades\Route;
Route::get('/', function () { // Route::get('/', function () {
return view('welcome'); // return view('welcome');
}); // });
+5 -1
View File
@@ -5,7 +5,11 @@ 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/filament/admin/theme.css',
'resources/css/app.css',
'resources/js/app.js'
],
refresh: true, refresh: true,
}), }),
tailwindcss(), tailwindcss(),