diff --git a/app/Filament/Resources/IncomingLetterResource.php b/app/Filament/Resources/IncomingLetterResource.php new file mode 100644 index 0000000..64e8a78 --- /dev/null +++ b/app/Filament/Resources/IncomingLetterResource.php @@ -0,0 +1,67 @@ +schema([ + TextInput::make('number') + ->required(), + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('number'), + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListIncomingLetters::route('/'), + 'create' => Pages\CreateIncomingLetter::route('/create'), + 'edit' => Pages\EditIncomingLetter::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/IncomingLetterResource/Pages/CreateIncomingLetter.php b/app/Filament/Resources/IncomingLetterResource/Pages/CreateIncomingLetter.php new file mode 100644 index 0000000..8aba75e --- /dev/null +++ b/app/Filament/Resources/IncomingLetterResource/Pages/CreateIncomingLetter.php @@ -0,0 +1,12 @@ +schema([ + TextInput::make('number') + ->required() + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('number') + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListOutgoingLetters::route('/'), + 'create' => Pages\CreateOutgoingLetter::route('/create'), + 'edit' => Pages\EditOutgoingLetter::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/OutgoingLetterResource/Pages/CreateOutgoingLetter.php b/app/Filament/Resources/OutgoingLetterResource/Pages/CreateOutgoingLetter.php new file mode 100644 index 0000000..a8ba817 --- /dev/null +++ b/app/Filament/Resources/OutgoingLetterResource/Pages/CreateOutgoingLetter.php @@ -0,0 +1,12 @@ +id(); + $table->string('number')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('incoming_letters'); + } +}; diff --git a/app/Modules/IncomingLetter/IncomingLetterModule.php b/app/Modules/IncomingLetter/IncomingLetterModule.php new file mode 100644 index 0000000..e712109 --- /dev/null +++ b/app/Modules/IncomingLetter/IncomingLetterModule.php @@ -0,0 +1,48 @@ +enabled; + } + + /** + * Disable module + */ + public function disable(): void + { + $this->enabled = false; + } + + /** + * Enable module + */ + public function enable(): void + { + $this->enabled = true; + } + + /** + * Check if module has a filament resource + */ + public function hasFilamentResource(): bool + { + return true; + } +} diff --git a/app/Modules/IncomingLetter/Models/IncomingLetter.php b/app/Modules/IncomingLetter/Models/IncomingLetter.php new file mode 100644 index 0000000..de249ae --- /dev/null +++ b/app/Modules/IncomingLetter/Models/IncomingLetter.php @@ -0,0 +1,11 @@ +id(); + $table->string('number')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('outgoing_letters'); + } +}; diff --git a/app/Modules/OutgoingLetter/Models/OutgoingLetter.php b/app/Modules/OutgoingLetter/Models/OutgoingLetter.php new file mode 100644 index 0000000..d6b350e --- /dev/null +++ b/app/Modules/OutgoingLetter/Models/OutgoingLetter.php @@ -0,0 +1,11 @@ +enabled; + } + + /** + * Disable module + */ + public function disable(): void + { + $this->enabled = false; + } + + /** + * Enable module + */ + public function enable(): void + { + $this->enabled = true; + } + + /** + * Check if module has a filament resource + */ + public function hasFilamentResource(): bool + { + return true; + } +} diff --git a/app/Modules/OutgoingLetter/Repositories/OutgoingLetterRepository.php b/app/Modules/OutgoingLetter/Repositories/OutgoingLetterRepository.php new file mode 100644 index 0000000..f360c87 --- /dev/null +++ b/app/Modules/OutgoingLetter/Repositories/OutgoingLetterRepository.php @@ -0,0 +1,10 @@ +