-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from achmadhadikurnia/main
Feature: Add filament resource
- Loading branch information
Showing
49 changed files
with
3,318 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources; | ||
|
||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AgamaResource\Pages; | ||
use Kanekescom\Siasn\Referensi\Models\Agama; | ||
|
||
class AgamaResource extends Resource | ||
{ | ||
protected static ?string $model = Agama::class; | ||
|
||
protected static ?string $slug = 'agama'; | ||
|
||
protected static ?string $pluralLabel = 'Agama'; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
protected static ?string $navigationLabel = 'Agama'; | ||
|
||
protected static ?string $navigationGroup = 'SIASN REFERENSI'; | ||
|
||
protected static bool $shouldRegisterNavigation = true; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('id') | ||
->maxLength(255) | ||
->label('ID'), | ||
Forms\Components\TextInput::make('nama') | ||
->maxLength(255), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id') | ||
->toggleable(isToggledHiddenByDefault: true) | ||
->searchable() | ||
->label('ID'), | ||
Tables\Columns\TextColumn::make('nama') | ||
->grow() | ||
->wrap() | ||
->sortable() | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('deleted_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\ActionGroup::make([ | ||
Tables\Actions\ViewAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageAgamas::route('/'), | ||
]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Filament/Resources/AgamaResource/Pages/ManageAgamas.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources\AgamaResource\Pages; | ||
|
||
use Filament\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
use Illuminate\Support\Facades\Artisan; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AgamaResource; | ||
|
||
class ManageAgamas extends ManageRecords | ||
{ | ||
protected static string $resource = AgamaResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\Action::make('sync') | ||
->requiresConfirmation() | ||
->action(fn () => Artisan::call('siasn-referensi:pull agama')), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources; | ||
|
||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AlasanHukumanDisiplinResource\Pages; | ||
use Kanekescom\Siasn\Referensi\Models\AlasanHukumanDisiplin; | ||
|
||
class AlasanHukumanDisiplinResource extends Resource | ||
{ | ||
protected static ?string $model = AlasanHukumanDisiplin::class; | ||
|
||
protected static ?string $slug = 'alasan-hukuman-disiplin'; | ||
|
||
protected static ?string $pluralLabel = 'Alasan Hukuman Disiplin'; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
protected static ?string $navigationLabel = 'Alasan Hukuman Disiplin'; | ||
|
||
protected static ?string $navigationGroup = 'SIASN REFERENSI'; | ||
|
||
protected static bool $shouldRegisterNavigation = true; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('id') | ||
->maxLength(255) | ||
->label('ID'), | ||
Forms\Components\Textarea::make('nama') | ||
->maxLength(65535) | ||
->columnSpanFull(), | ||
Forms\Components\TextInput::make('keterangan') | ||
->maxLength(255), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id') | ||
->toggleable(isToggledHiddenByDefault: true) | ||
->searchable() | ||
->label('ID'), | ||
Tables\Columns\TextColumn::make('nama') | ||
->grow() | ||
->wrap() | ||
->sortable() | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('keterangan') | ||
->wrap() | ||
->sortable() | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('deleted_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\ActionGroup::make([ | ||
Tables\Actions\ViewAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageAlasanHukumanDisiplins::route('/'), | ||
]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Filament/Resources/AlasanHukumanDisiplinResource/Pages/ManageAlasanHukumanDisiplins.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources\AlasanHukumanDisiplinResource\Pages; | ||
|
||
use Filament\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
use Illuminate\Support\Facades\Artisan; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AlasanHukumanDisiplinResource; | ||
|
||
class ManageAlasanHukumanDisiplins extends ManageRecords | ||
{ | ||
protected static string $resource = AlasanHukumanDisiplinResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\Action::make('sync') | ||
->requiresConfirmation() | ||
->action(fn () => Artisan::call('siasn-referensi:pull alasan-hukuman-disiplin')), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources; | ||
|
||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AsnJenisJabatanResource\Pages; | ||
use Kanekescom\Siasn\Referensi\Models\AsnJenisJabatan; | ||
|
||
class AsnJenisJabatanResource extends Resource | ||
{ | ||
protected static ?string $model = AsnJenisJabatan::class; | ||
|
||
protected static ?string $slug = 'asn-jenis-jabatan'; | ||
|
||
protected static ?string $pluralLabel = 'ASN Jenis Jabatan'; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
protected static ?string $navigationLabel = 'ASN Jenis Jabatan'; | ||
|
||
protected static ?string $navigationGroup = 'SIASN REFERENSI'; | ||
|
||
protected static bool $shouldRegisterNavigation = true; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('id') | ||
->maxLength(255) | ||
->label('ID'), | ||
Forms\Components\TextInput::make('nama') | ||
->maxLength(255), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('id') | ||
->toggleable(isToggledHiddenByDefault: true) | ||
->searchable() | ||
->label('ID'), | ||
Tables\Columns\TextColumn::make('nama') | ||
->grow() | ||
->wrap() | ||
->sortable() | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('deleted_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\ActionGroup::make([ | ||
Tables\Actions\ViewAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ManageAsnJenisJabatans::route('/'), | ||
]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Filament/Resources/AsnJenisJabatanResource/Pages/ManageAsnJenisJabatans.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Kanekescom\Siasn\Referensi\Filament\Resources\AsnJenisJabatanResource\Pages; | ||
|
||
use Filament\Actions; | ||
use Filament\Resources\Pages\ManageRecords; | ||
use Illuminate\Support\Facades\Artisan; | ||
use Kanekescom\Siasn\Referensi\Filament\Resources\AsnJenisJabatanResource; | ||
|
||
class ManageAsnJenisJabatans extends ManageRecords | ||
{ | ||
protected static string $resource = AsnJenisJabatanResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\Action::make('sync') | ||
->requiresConfirmation() | ||
->action(fn () => Artisan::call('siasn-referensi:pull asn-jenis-jabatan')), | ||
]; | ||
} | ||
} |
Oops, something went wrong.