mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
update filamentphp basic
This commit is contained in:
@@ -10,7 +10,7 @@ class EditUser extends EditRecord
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\DeleteAction::make(),
|
||||
|
||||
@@ -13,7 +13,7 @@ class ListUsers extends PageList
|
||||
{
|
||||
protected static string $resource = UserResource::class;
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
@@ -28,7 +28,7 @@ class ListUsers extends PageList
|
||||
|
||||
protected function getTableFiltersLayout(): ?string
|
||||
{
|
||||
return Layout::AboveContent;
|
||||
return \Filament\Tables\Enums\FiltersLayout::AboveContent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class UserProfile extends ViewRecord
|
||||
$this->record = $this->resolveRecord($id);
|
||||
}
|
||||
|
||||
protected function getActions(): array
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
$actions = [];
|
||||
if (Auth::user()->class > $this->record->class) {
|
||||
@@ -160,7 +160,7 @@ class UserProfile extends ViewRecord
|
||||
Forms\Components\TextInput::make('duration')->integer()
|
||||
->label(__('admin.resources.user.actions.change_bonus_etc_duration_label'))
|
||||
->helperText(__('admin.resources.user.actions.change_bonus_etc_duration_help'))
|
||||
->hidden(fn (\Closure $get) => $get('field') != 'tmp_invites')
|
||||
->hidden(fn (\Filament\Forms\Get $get) => $get('field') != 'tmp_invites')
|
||||
,
|
||||
|
||||
Forms\Components\TextInput::make('reason')
|
||||
@@ -380,13 +380,13 @@ class UserProfile extends ViewRecord
|
||||
->default($this->record->vip_added)
|
||||
->label(__('user.labels.vip_added'))
|
||||
->helperText(__('user.labels.vip_added_help'))
|
||||
->hidden(fn (\Closure $get) => $get('class') != User::CLASS_VIP)
|
||||
->hidden(fn (\Filament\Forms\Get $get) => $get('class') != User::CLASS_VIP)
|
||||
,
|
||||
Forms\Components\DateTimePicker::make('vip_until')
|
||||
->default($this->record->vip_until)
|
||||
->label(__('user.labels.vip_until'))
|
||||
->helperText(__('user.labels.vip_until_help'))
|
||||
->hidden(fn (\Closure $get) => $get('class') != User::CLASS_VIP)
|
||||
->hidden(fn (\Filament\Forms\Get $get) => $get('class') != User::CLASS_VIP)
|
||||
,
|
||||
Forms\Components\TextInput::make('reason')
|
||||
->label(__('admin.resources.user.actions.enable_disable_reason'))
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Filament\Resources\User\UserResource\RelationManagers;
|
||||
|
||||
use Filament\Forms;
|
||||
use Filament\Resources\Form;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\RelationManagers\RelationManager;
|
||||
use Filament\Resources\Table;
|
||||
use Filament\Tables\Table;
|
||||
use Filament\Tables;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
@@ -16,7 +16,7 @@ class MedalsRelationManager extends RelationManager
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'name';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
@@ -26,7 +26,7 @@ class MedalsRelationManager extends RelationManager
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
|
||||
Reference in New Issue
Block a user