You've already forked Epicnabbo-Catalogus-Updated-Daily
feat: update various Filament resources and models for enhanced functionality
This commit is contained in:
@@ -7,7 +7,7 @@ use App\Filament\Resources\Atom\Teams\Pages\EditTeam;
|
||||
use App\Filament\Resources\Atom\Teams\Pages\ListTeams;
|
||||
use App\Filament\Tables\Columns\HabboBadgeColumn;
|
||||
use App\Filament\Traits\TranslatableResource;
|
||||
use App\Models\Community\Staff\WebsiteTeam;
|
||||
use App\Models\Community\Staff\WebsiteStaffTeam;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
@@ -24,7 +24,7 @@ class TeamResource extends Resource
|
||||
{
|
||||
use TranslatableResource;
|
||||
|
||||
protected static ?string $model = WebsiteTeam::class;
|
||||
protected static ?string $model = WebsiteStaffTeam::class;
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-user-group';
|
||||
|
||||
@@ -82,7 +82,7 @@ class TeamResource extends Resource
|
||||
|
||||
IconColumn::make('hidden_rank')
|
||||
->label(__('filament::resources.columns.is_hidden'))
|
||||
->icon(fn (\App\Models\Community\Staff\WebsiteTeam $record) => $record->hidden_rank ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
|
||||
->icon(fn (\App\Models\Community\Staff\WebsiteStaffTeam $record) => $record->hidden_rank ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
|
||||
->colors([
|
||||
'danger' => false,
|
||||
'success' => true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors\Pages;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors\Pages;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors\Pages;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors\Pages;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\CatalogEditors\Pages;
|
||||
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Hotel\OpenPositions;
|
||||
|
||||
use App\Filament\Resources\Hotel\OpenPositions\Pages\CreateOpenPosition;
|
||||
use App\Filament\Resources\Hotel\OpenPositions\Pages\EditOpenPosition;
|
||||
use App\Filament\Resources\Hotel\OpenPositions\Pages\ListOpenPositions;
|
||||
use App\Models\Community\Staff\WebsiteOpenPosition;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class OpenPositionResource extends Resource
|
||||
{
|
||||
protected static ?string $model = WebsiteOpenPosition::class;
|
||||
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-briefcase';
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Hotel';
|
||||
|
||||
#[\Override]
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Select::make('permission_id')
|
||||
->label('Rank')
|
||||
->relationship('permission', 'rank_name')
|
||||
->required()
|
||||
->searchable()
|
||||
->preload()
|
||||
->unique(ignoreRecord: true)
|
||||
->placeholder('Select a rank'),
|
||||
Textarea::make('description')
|
||||
->label('Position Description')
|
||||
->required()
|
||||
->maxLength(65535)
|
||||
->columnSpanFull(),
|
||||
DateTimePicker::make('apply_from')
|
||||
->label('Application Start Date')
|
||||
->nullable(),
|
||||
DateTimePicker::make('apply_to')
|
||||
->label('Application End Date')
|
||||
->nullable(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[\Override]
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('permission.rank_name')
|
||||
->label('Rank')
|
||||
->sortable()
|
||||
->searchable(),
|
||||
TextColumn::make('description')
|
||||
->label('Description')
|
||||
->limit(50)
|
||||
->searchable(),
|
||||
TextColumn::make('apply_from')
|
||||
->label('Apply From')
|
||||
->dateTime()
|
||||
->sortable(),
|
||||
TextColumn::make('apply_to')
|
||||
->label('Apply To')
|
||||
->dateTime()
|
||||
->sortable(),
|
||||
TextColumn::make('created_at')
|
||||
->label('Created')
|
||||
->dateTime()
|
||||
->sortable(),
|
||||
])
|
||||
->filters([
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
DeleteAction::make()
|
||||
->requiresConfirmation()
|
||||
->modalHeading('Delete Open Position')
|
||||
->modalDescription('This will also delete all related staff applications. Are you sure?')
|
||||
->modalSubmitActionLabel('Yes, delete')
|
||||
->successNotification(
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Open Position Deleted')
|
||||
->body('The open position and its related staff applications have been deleted successfully.'),
|
||||
),
|
||||
])
|
||||
->toolbarActions([
|
||||
DeleteBulkAction::make()
|
||||
->requiresConfirmation()
|
||||
->modalHeading('Delete Open Positions')
|
||||
->modalDescription('This will also delete all related staff applications for the selected positions. Are you sure?')
|
||||
->modalSubmitActionLabel('Yes, delete')
|
||||
->successNotification(
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Open Positions Deleted')
|
||||
->body('The selected open positions and their related staff applications have been deleted successfully.'),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListOpenPositions::route('/'),
|
||||
'create' => CreateOpenPosition::route('/create'),
|
||||
'edit' => EditOpenPosition::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -92,8 +92,8 @@ class OpenPositionResource extends Resource
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Open Position Deleted')
|
||||
->body('The open position and its related staff applications have been deleted successfully.'),
|
||||
),
|
||||
->body('The open position and its related staff applications have been deleted successfully.')
|
||||
)
|
||||
])
|
||||
->toolbarActions([
|
||||
DeleteBulkAction::make()
|
||||
@@ -105,8 +105,8 @@ class OpenPositionResource extends Resource
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Open Positions Deleted')
|
||||
->body('The selected open positions and their related staff applications have been deleted successfully.'),
|
||||
),
|
||||
->body('The selected open positions and their related staff applications have been deleted successfully.')
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -118,4 +118,4 @@ class OpenPositionResource extends Resource
|
||||
'edit' => EditOpenPosition::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ use App\Filament\Resources\User\Users\RelationManagers\ChatLogRelationManager;
|
||||
use App\Filament\Resources\User\Users\RelationManagers\SettingsRelationManager;
|
||||
use App\Filament\Tables\Columns\UserAvatarColumn;
|
||||
use App\Filament\Traits\TranslatableResource;
|
||||
use App\Models\Community\Staff\WebsiteTeam;
|
||||
use App\Models\Community\Staff\WebsiteStaffTeam;
|
||||
use App\Models\Game\Permission;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\EditAction;
|
||||
@@ -31,6 +31,7 @@ use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class UserResource extends Resource
|
||||
@@ -118,7 +119,7 @@ class UserResource extends Resource
|
||||
Select::make('team_id')
|
||||
->native(false)
|
||||
->label(__('filament::resources.inputs.team_id'))
|
||||
->options(fn () => WebsiteTeam::query()->pluck('rank_name', 'id')->all())
|
||||
->options(fn () => WebsiteStaffTeam::query()->pluck('rank_name', 'id')->all())
|
||||
->columnSpanFull(),
|
||||
])->columns(['sm' => 2]),
|
||||
|
||||
@@ -190,14 +191,14 @@ class UserResource extends Resource
|
||||
Select::make('rank')
|
||||
->native(false)
|
||||
->label(__('filament::resources.inputs.rank'))
|
||||
->options(fn () => (function (): array {
|
||||
$authUser = auth()->user();
|
||||
->options(function (): array {
|
||||
$authUser = Auth::user();
|
||||
$rank = $authUser instanceof User ? $authUser->rank : 0;
|
||||
return Permission::query()
|
||||
->where('id', '<', $rank)
|
||||
->pluck('rank_name', 'id')
|
||||
->all();
|
||||
})()),
|
||||
}),
|
||||
|
||||
Toggle::make('is_hidden')
|
||||
->label(__('filament::resources.inputs.is_hidden'))
|
||||
|
||||
@@ -6,7 +6,7 @@ use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class WebsiteTeam extends Model
|
||||
class WebsiteStaffTeam extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace App\Models;
|
||||
use App\Models\Articles\WebsiteArticle;
|
||||
use App\Models\Articles\WebsiteArticleComment;
|
||||
use App\Models\Community\Staff\WebsiteStaffApplications;
|
||||
use App\Models\Community\Staff\WebsiteTeam;
|
||||
use App\Models\Community\Staff\WebsiteStaffTeam;
|
||||
use App\Models\Game\Furniture\Item;
|
||||
use App\Models\Game\Permission;
|
||||
use App\Models\Game\Player\MessengerFriendship;
|
||||
@@ -239,11 +239,11 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<WebsiteTeam, $this>
|
||||
* @return BelongsTo<WebsiteStaffTeam, $this>
|
||||
*/
|
||||
public function team(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(WebsiteTeam::class, 'team_id');
|
||||
return $this->belongsTo(WebsiteStaffTeam::class, 'team_id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Community\Staff\WebsiteTeam;
|
||||
use App\Models\Community\Staff\WebsiteStaffTeam;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class WebsiteTeamSeeder extends Seeder
|
||||
@@ -15,6 +15,6 @@ class WebsiteTeamSeeder extends Seeder
|
||||
['rank_name' => 'Event planner'],
|
||||
];
|
||||
|
||||
WebsiteTeam::query()->upsert($teams, ['rank_name']);
|
||||
WebsiteStaffTeam::query()->upsert($teams, ['rank_name']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,3 +126,15 @@
|
||||
[2026-01-21 16:52:16] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||
[2026-01-21 16:52:48] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||
[2026-01-21 16:52:48] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd
|
||||
[2026-01-24 20:16:08] production.ERROR: Namespace declaration statement has to be the very first statement or after any declare call in the script {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Namespace declaration statement has to be the very first statement or after any declare call in the script at C:/Github/Epicnabbo-Catalogus-2025FullPack-Updated-Daily/Updated_Cms/app/Filament/Resources/Hotel/CatalogEditors/CatalogEditorResource.php:3)
|
||||
[stacktrace]
|
||||
#0 {main}
|
||||
"}
|
||||
[2026-01-24 20:16:50] production.ERROR: Cannot redeclare class App\Filament\Resources\Hotel\OpenPositions\OpenPositionResource (previously declared in C:\Github\Epicnabbo-Catalogus-2025FullPack-Updated-Daily\Updated_Cms\app\Filament\Resources\Hotel\OpenPositions\OpenPositionResource.php:21) {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Cannot redeclare class App\\Filament\\Resources\\Hotel\\OpenPositions\\OpenPositionResource (previously declared in C:\\Github\\Epicnabbo-Catalogus-2025FullPack-Updated-Daily\\Updated_Cms\\app\\Filament\\Resources\\Hotel\\OpenPositions\\OpenPositionResource.php:21) at C:/Github/Epicnabbo-Catalogus-2025FullPack-Updated-Daily/Updated_Cms/app/Filament/Resources/Hotel/OpenPositions/OpenPositionResource_clean.php:21)
|
||||
[stacktrace]
|
||||
#0 {main}
|
||||
"}
|
||||
[2026-01-24 20:20:30] production.ERROR: Cannot redeclare class App\Filament\Resources\Hotel\OpenPositions\OpenPositionResource (previously declared in C:\Github\Epicnabbo-Catalogus-2025FullPack-Updated-Daily\Updated_Cms\app\Filament\Resources\Hotel\OpenPositions\OpenPositionResource.php:21) {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Cannot redeclare class App\\Filament\\Resources\\Hotel\\OpenPositions\\OpenPositionResource (previously declared in C:\\Github\\Epicnabbo-Catalogus-2025FullPack-Updated-Daily\\Updated_Cms\\app\\Filament\\Resources\\Hotel\\OpenPositions\\OpenPositionResource.php:21) at C:/Github/Epicnabbo-Catalogus-2025FullPack-Updated-Daily/Updated_Cms/app/Filament/Resources/Hotel/OpenPositions/OpenPositionResource_clean.php:21)
|
||||
[stacktrace]
|
||||
#0 {main}
|
||||
"}
|
||||
|
||||
Reference in New Issue
Block a user