diff --git a/app/Filament/Superman/Resources/JamaahResource.php b/app/Filament/Superman/Resources/JamaahResource.php index 858b570..e0747c9 100644 --- a/app/Filament/Superman/Resources/JamaahResource.php +++ b/app/Filament/Superman/Resources/JamaahResource.php @@ -9,6 +9,7 @@ use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; +use Filament\Tables\Filters; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\SoftDeletingScope; @@ -19,31 +20,46 @@ class JamaahResource extends Resource protected static ?string $navigationIcon = 'heroicon-o-users'; protected static ?string $navigationLabel = 'Jamaah'; + protected static ?string $pluralLabel = 'Jamaah'; public static function form(Form $form): Form { return $form ->schema([ - // - ]); + Forms\Components\TextInput::make('name')->required(), + Forms\Components\TextInput::make('website') + ->suffix('.jamaah.com') + ->prefixIcon('heroicon-m-globe-alt') + ->required() + ->alphaDash() + ->unique(table: Jamaah::class, column: "website", ignoreRecord: true), + Forms\Components\Select::make("type")->options([ + 'masjid' => 'Masjid', + 'majelis' => 'Majelis', + ]) + ->selectablePlaceholder(false) + ->required() + + ])->columns(1); } public static function table(Table $table): Table { return $table ->columns([ - // + Tables\Columns\TextColumn::make('name'), + Tables\Columns\TextColumn::make('website'), + Tables\Columns\TextColumn::make('type'), ]) ->filters([ - // + Filters\SelectFilter::make('type') + ->options([ + 'masjid' => 'Masjid', + 'majelis' => 'Majelis', + ]) ]) ->actions([ - Tables\Actions\EditAction::make(), - ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), - ]), + Tables\Actions\DeleteAction::make(), ]); } diff --git a/app/Filament/Superman/Resources/JamaahResource/Pages/CreateJamaah.php b/app/Filament/Superman/Resources/JamaahResource/Pages/CreateJamaah.php index e1dcd21..966aa6e 100644 --- a/app/Filament/Superman/Resources/JamaahResource/Pages/CreateJamaah.php +++ b/app/Filament/Superman/Resources/JamaahResource/Pages/CreateJamaah.php @@ -9,4 +9,5 @@ class CreateJamaah extends CreateRecord { protected static string $resource = JamaahResource::class; + protected static bool $canCreateAnother = false; } diff --git a/app/Filament/Superman/Resources/UsersResource.php b/app/Filament/Superman/Resources/UsersResource.php index d3c2d06..22178c9 100644 --- a/app/Filament/Superman/Resources/UsersResource.php +++ b/app/Filament/Superman/Resources/UsersResource.php @@ -6,7 +6,6 @@ use App\Filament\Superman\Resources\UsersResource\RelationManagers; use App\Models\User; use Filament\Forms; -use Filament\Forms\Components\Select; use Filament\Forms\Form; use Filament\Resources\Resource; use Filament\Tables; @@ -24,26 +23,27 @@ public static function form(Form $form): Form { return $form ->schema([ - Select::make('roles')->multiple()->relationship('roles', 'name') - ]); + Forms\Components\TextInput::make('name')->required(), + Forms\Components\Select::make('roles') + ->relationship('roles', 'name') + ->selectablePlaceholder(false) + ->required() + ])->columns(1); } public static function table(Table $table): Table { return $table ->columns([ - // + Tables\Columns\TextColumn::make('name'), + Tables\Columns\TextColumn::make('email'), + Tables\Columns\TextColumn::make('created_at')->label("Register date"), ]) ->filters([ // ]) ->actions([ - Tables\Actions\EditAction::make(), - ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), - ]), + Tables\Actions\DeleteAction::make(), ]); } diff --git a/app/Filament/Superman/Resources/UsersResource/Pages/CreateUsers.php b/app/Filament/Superman/Resources/UsersResource/Pages/CreateUsers.php index f3aacbf..6167dbd 100644 --- a/app/Filament/Superman/Resources/UsersResource/Pages/CreateUsers.php +++ b/app/Filament/Superman/Resources/UsersResource/Pages/CreateUsers.php @@ -9,4 +9,5 @@ class CreateUsers extends CreateRecord { protected static string $resource = UsersResource::class; + protected static bool $canCreateAnother = false; }