-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to files: Classes/Realestate.php
Models/.gitkeep Models/Building.php Models/BuildingUnitSetup.php Models/Data/Building.php Models/Data/Estate.php Models/Data/Region.php Models/Data/Town.php Models/Estate.php Models/ReadingElectricity.php Models/ReadingGas.php Models/ReadingWater.php Models/Region.php Models/Tenancy.php Models/TenancyInvoice.php Models/TenancyService.php Models/Town.php Models/Unit.php Models/UnitSetup.php Tests/Feature/.gitkeep Tests/Unit/.gitkeep composer.json
- Loading branch information
1 parent
c4bf1c1
commit 3aef409
Showing
78 changed files
with
2,280 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
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,127 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingResource\Pages; | ||
use Modules\Realestate\Filament\Resources\BuildingResource\RelationManagers; | ||
use Modules\Realestate\Models\Building; | ||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class BuildingResource extends Resource | ||
{ | ||
protected static ?string $model = Building::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('name') | ||
->maxLength(255) | ||
->default(null), | ||
Forms\Components\TextInput::make('slug') | ||
->maxLength(255) | ||
->default(null), | ||
Forms\Components\TextInput::make('estate_id') | ||
->required() | ||
->numeric(), | ||
Forms\Components\TextInput::make('type'), | ||
Forms\Components\Textarea::make('description') | ||
->columnSpanFull(), | ||
Forms\Components\TextInput::make('units') | ||
->numeric() | ||
->default(null), | ||
Forms\Components\TextInput::make('default_deposit') | ||
->numeric() | ||
->default(null), | ||
Forms\Components\TextInput::make('default_goodwill') | ||
->numeric() | ||
->default(null), | ||
Forms\Components\TextInput::make('default_amount') | ||
->numeric() | ||
->default(null), | ||
Forms\Components\Toggle::make('is_full'), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('slug') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('estate_id') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('type'), | ||
Tables\Columns\TextColumn::make('units') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('default_deposit') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('default_goodwill') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('default_amount') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\IconColumn::make('is_full') | ||
->boolean(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
Tables\Filters\TrashedFilter::make(), | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
Tables\Actions\ForceDeleteBulkAction::make(), | ||
Tables\Actions\RestoreBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListBuildings::route('/'), | ||
'create' => Pages\CreateBuilding::route('/create'), | ||
'edit' => Pages\EditBuilding::route('/{record}/edit'), | ||
]; | ||
} | ||
|
||
public static function getEloquentQuery(): Builder | ||
{ | ||
return parent::getEloquentQuery() | ||
->withoutGlobalScopes([ | ||
SoftDeletingScope::class, | ||
]); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
app/Filament/Resources/BuildingResource/Pages/CreateBuilding.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,12 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateBuilding extends CreateRecord | ||
{ | ||
protected static string $resource = BuildingResource::class; | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/BuildingResource/Pages/EditBuilding.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,21 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditBuilding extends EditRecord | ||
{ | ||
protected static string $resource = BuildingResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
Actions\ForceDeleteAction::make(), | ||
Actions\RestoreAction::make(), | ||
]; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/BuildingResource/Pages/ListBuildings.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,19 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListBuildings extends ListRecords | ||
{ | ||
protected static string $resource = BuildingResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make(), | ||
]; | ||
} | ||
} |
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,102 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingUnitSetupResource\Pages; | ||
use Modules\Realestate\Filament\Resources\BuildingUnitSetupResource\RelationManagers; | ||
use Modules\Realestate\Models\BuildingUnitSetup; | ||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Illuminate\Database\Eloquent\SoftDeletingScope; | ||
|
||
class BuildingUnitSetupResource extends Resource | ||
{ | ||
protected static ?string $model = BuildingUnitSetup::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('title') | ||
->maxLength(255) | ||
->default(null), | ||
Forms\Components\TextInput::make('slug') | ||
->maxLength(255) | ||
->default(null), | ||
Forms\Components\TextInput::make('amount') | ||
->numeric() | ||
->default(null), | ||
Forms\Components\TextInput::make('building_id') | ||
->required() | ||
->numeric(), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('title') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('slug') | ||
->searchable(), | ||
Tables\Columns\TextColumn::make('amount') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('building_id') | ||
->numeric() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->dateTime() | ||
->sortable() | ||
->toggleable(isToggledHiddenByDefault: true), | ||
]) | ||
->filters([ | ||
Tables\Filters\TrashedFilter::make(), | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
Tables\Actions\ForceDeleteBulkAction::make(), | ||
Tables\Actions\RestoreBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListBuildingUnitSetups::route('/'), | ||
'create' => Pages\CreateBuildingUnitSetup::route('/create'), | ||
'edit' => Pages\EditBuildingUnitSetup::route('/{record}/edit'), | ||
]; | ||
} | ||
|
||
public static function getEloquentQuery(): Builder | ||
{ | ||
return parent::getEloquentQuery() | ||
->withoutGlobalScopes([ | ||
SoftDeletingScope::class, | ||
]); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
app/Filament/Resources/BuildingUnitSetupResource/Pages/CreateBuildingUnitSetup.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,12 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingUnitSetupResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingUnitSetupResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateBuildingUnitSetup extends CreateRecord | ||
{ | ||
protected static string $resource = BuildingUnitSetupResource::class; | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/BuildingUnitSetupResource/Pages/EditBuildingUnitSetup.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,21 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingUnitSetupResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingUnitSetupResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditBuildingUnitSetup extends EditRecord | ||
{ | ||
protected static string $resource = BuildingUnitSetupResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
Actions\ForceDeleteAction::make(), | ||
Actions\RestoreAction::make(), | ||
]; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/BuildingUnitSetupResource/Pages/ListBuildingUnitSetups.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,19 @@ | ||
<?php | ||
|
||
namespace Modules\Realestate\Filament\Resources\BuildingUnitSetupResource\Pages; | ||
|
||
use Modules\Realestate\Filament\Resources\BuildingUnitSetupResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListBuildingUnitSetups extends ListRecords | ||
{ | ||
protected static string $resource = BuildingUnitSetupResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make(), | ||
]; | ||
} | ||
} |
Oops, something went wrong.