RawaN
Issue: Filament Shield
In my filament project used filament shield for role and permission and now in the created page i have this error !
{
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
"alperenersoy/filament-export": "3.x-dev",
"aymanalhattami/filament-context-menu": "^1.0",
"barryvdh/laravel-dompdf": "^2.2",
"bezhansalleh/filament-language-switch": "^3.1",
"bezhansalleh/filament-shield": "*",
"eightynine/filament-advanced-widgets": "^3.0",
"filament/filament": "^3.2",
"filament/forms": "^3.2",
"guava/filament-clusters": "^1.4",
"joaopaulolndev/filament-edit-profile": "^1.0",
"joshembling/image-optimizer": "^1.4",
"laravel/framework": "^11.0",
"laravel/reverb": "^1.0",
"laravel/tinker": "^2.9",
"leandrocfe/filament-apex-charts": "^3.1",
"psr/simple-cache": "3.0",
"pxlrbt/filament-excel": "^2.3",
"shuvroroy/filament-spatie-laravel-backup": "^2.2",
"simplesoftwareio/simple-qrcode": "^4.2",
"smalot/pdfparser": "^2.11",
"z3d0x/filament-logger": "^0.7.2"
},
}
{
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": [
"laravel",
"framework"
],
"license": "MIT",
"require": {
"php": "^8.2",
"alperenersoy/filament-export": "3.x-dev",
"aymanalhattami/filament-context-menu": "^1.0",
"barryvdh/laravel-dompdf": "^2.2",
"bezhansalleh/filament-language-switch": "^3.1",
"bezhansalleh/filament-shield": "*",
"eightynine/filament-advanced-widgets": "^3.0",
"filament/filament": "^3.2",
"filament/forms": "^3.2",
"guava/filament-clusters": "^1.4",
"joaopaulolndev/filament-edit-profile": "^1.0",
"joshembling/image-optimizer": "^1.4",
"laravel/framework": "^11.0",
"laravel/reverb": "^1.0",
"laravel/tinker": "^2.9",
"leandrocfe/filament-apex-charts": "^3.1",
"psr/simple-cache": "3.0",
"pxlrbt/filament-excel": "^2.3",
"shuvroroy/filament-spatie-laravel-backup": "^2.2",
"simplesoftwareio/simple-qrcode": "^4.2",
"smalot/pdfparser": "^2.11",
"z3d0x/filament-logger": "^0.7.2"
},
}
3 replies
Modal Action not work
->extraModalFooterActions([
Action::make('250dinar')
->label('250 Dinar')
->extraAttributes(['class' => 'w-1/2 !h-full'])
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 250);
}),
Action::make('500dinar')
->label('500 Dinar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 500);
}),
Action::make('1hazar')
->label('1 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 1000);
}),
Action::make('5hazar')
->label('5 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 5000);
}),
Action::make('10hazar')
->label('10 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 10000);
}),
])
->extraModalFooterActions([
Action::make('250dinar')
->label('250 Dinar')
->extraAttributes(['class' => 'w-1/2 !h-full'])
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 250);
}),
Action::make('500dinar')
->label('500 Dinar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 500);
}),
Action::make('1hazar')
->label('1 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 1000);
}),
Action::make('5hazar')
->label('5 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 5000);
}),
Action::make('10hazar')
->label('10 Hazar')
->action(function (Get $get, Set $set) {
$this->updatePaidAndPayback($get, $set, 10000);
}),
])
5 replies
how to set the widget to full for each widget in custom Dashbaord
class Dashboard extends Page
{
protected static string $routePath = '/';
protected int | string | array $columnSpan = 'full';
protected static ?int $navigationSort = -2;
protected static string $view = 'filament.pages.dashboard';
public static function getNavigationLabel(): string
{
return static::$navigationLabel ??
static::$title ??
__('filament-panels::pages/dashboard.title');
}
public function getTitle(): string|Htmlable
{
return static::$title ?? __('filament-panels::pages/dashboard.title');
}
public static function getRoutePath(): string
{
return static::$routePath;
}
public function getHeaderWidgets(): array
{
return [
AccountWidget::class,
BadgeWidget::class,
];
}
public static function getNavigationIcon(): string|Htmlable|null
{
return static::$navigationIcon
?? FilamentIcon::resolve('panels::pages.dashboard.navigation-item')
?? (Filament::hasTopNavigation() ? 'heroicon-m-home' : 'heroicon-o-home');
}
}
class Dashboard extends Page
{
protected static string $routePath = '/';
protected int | string | array $columnSpan = 'full';
protected static ?int $navigationSort = -2;
protected static string $view = 'filament.pages.dashboard';
public static function getNavigationLabel(): string
{
return static::$navigationLabel ??
static::$title ??
__('filament-panels::pages/dashboard.title');
}
public function getTitle(): string|Htmlable
{
return static::$title ?? __('filament-panels::pages/dashboard.title');
}
public static function getRoutePath(): string
{
return static::$routePath;
}
public function getHeaderWidgets(): array
{
return [
AccountWidget::class,
BadgeWidget::class,
];
}
public static function getNavigationIcon(): string|Htmlable|null
{
return static::$navigationIcon
?? FilamentIcon::resolve('panels::pages.dashboard.navigation-item')
?? (Filament::hasTopNavigation() ? 'heroicon-m-home' : 'heroicon-o-home');
}
}
use App\Enums\Status;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use App\Models\House;
class BadgeWidget extends BaseWidget
{
protected static string $view = 'filament.widgets.badge-widget';
protected int | string | array $columnSpan = 'full';
public function getRecords()
{
return House::all();
}
public function getBadgeColor($status)
{
return match ($status) {
Status::SOLD => 'success',
Status::RESERVATION => 'danger',
Status::DAILY => 'warning',
Status::COMPANY => 'primary',
Status::AVAILABLE => 'info',
default => 'gray',
};
}
}
use App\Enums\Status;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use App\Models\House;
class BadgeWidget extends BaseWidget
{
protected static string $view = 'filament.widgets.badge-widget';
protected int | string | array $columnSpan = 'full';
public function getRecords()
{
return House::all();
}
public function getBadgeColor($status)
{
return match ($status) {
Status::SOLD => 'success',
Status::RESERVATION => 'danger',
Status::DAILY => 'warning',
Status::COMPANY => 'primary',
Status::AVAILABLE => 'info',
default => 'gray',
};
}
}
5 replies