-
-
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.
- Loading branch information
Showing
54 changed files
with
18,226 additions
and
90 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Concerns; | ||
|
||
use App\Models\Organization; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
trait BelongsToOrganization | ||
{ | ||
public function initializeBelongsToOrganization(): void | ||
{ | ||
$this->fillable[] = 'organization_id'; | ||
} | ||
|
||
protected static function bootBelongsToOrganization(): void | ||
{ | ||
static::creating(function (self $model) { | ||
if (! auth()->check()) { | ||
return; | ||
} | ||
|
||
$model->organization_id = auth()->user()->organization_id; | ||
}); | ||
} | ||
|
||
public function organization(): BelongsTo | ||
{ | ||
return $this->belongsTo(Organization::class); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Pages; | ||
|
||
use Filament\Pages\Dashboard as BaseDashboard; | ||
use Illuminate\Contracts\Support\Htmlable; | ||
|
||
class Dashboard extends BaseDashboard | ||
{ | ||
public function getHeading(): string | Htmlable | ||
{ | ||
return __('dashboard.welcome', [ | ||
'name' => auth()->user()->first_name, | ||
]); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Pages\Tenancy; | ||
|
||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Pages\Tenancy\EditTenantProfile; | ||
|
||
class EditOrganizationProfile extends EditTenantProfile | ||
{ | ||
public static function getLabel(): string | ||
{ | ||
return 'Team profile'; | ||
} | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
TextInput::make('name'), | ||
// ... | ||
]); | ||
} | ||
} |
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,82 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\BeneficiaryResource\Pages; | ||
use App\Models\Beneficiary; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
|
||
class BeneficiaryResource extends Resource | ||
{ | ||
protected static ?string $model = Beneficiary::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-users'; | ||
|
||
public static function getNavigationGroup(): ?string | ||
{ | ||
return __('navigation.beneficiaries._group'); | ||
} | ||
|
||
public static function getNavigationLabel(): string | ||
{ | ||
return __('navigation.beneficiaries.cases'); | ||
} | ||
|
||
public static function getModelLabel(): string | ||
{ | ||
return __('beneficiary.label.singular'); | ||
} | ||
|
||
public static function getPluralModelLabel(): string | ||
{ | ||
return __('beneficiary.label.plural'); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
// | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
// | ||
]) | ||
->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\ListBeneficiaries::route('/'), | ||
'create' => Pages\CreateBeneficiary::route('/create'), | ||
'edit' => Pages\EditBeneficiary::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/Filament/Resources/BeneficiaryResource/Pages/CreateBeneficiary.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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\BeneficiaryResource\Pages; | ||
|
||
use App\Filament\Resources\BeneficiaryResource; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateBeneficiary extends CreateRecord | ||
{ | ||
protected static string $resource = BeneficiaryResource::class; | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/BeneficiaryResource/Pages/EditBeneficiary.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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\BeneficiaryResource\Pages; | ||
|
||
use App\Filament\Resources\BeneficiaryResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditBeneficiary extends EditRecord | ||
{ | ||
protected static string $resource = BeneficiaryResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
]; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/BeneficiaryResource/Pages/ListBeneficiaries.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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\BeneficiaryResource\Pages; | ||
|
||
use App\Filament\Resources\BeneficiaryResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListBeneficiaries extends ListRecords | ||
{ | ||
protected static string $resource = BeneficiaryResource::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,90 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\UserResource\Pages; | ||
use App\Models\User; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Columns\TextColumn; | ||
use Filament\Tables\Table; | ||
|
||
class UserResource extends Resource | ||
{ | ||
protected static ?string $model = User::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-user-group'; | ||
|
||
protected static ?string $tenantOwnershipRelationshipName = 'organizations'; | ||
|
||
public static function getNavigationGroup(): ?string | ||
{ | ||
return __('navigation.configurations._group'); | ||
} | ||
|
||
public static function getNavigationLabel(): string | ||
{ | ||
return __('navigation.configurations.staff'); | ||
} | ||
|
||
public static function getModelLabel(): string | ||
{ | ||
return __('user.label.singular'); | ||
} | ||
|
||
public static function getPluralModelLabel(): string | ||
{ | ||
return __('user.label.plural'); | ||
} | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
// | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
TextColumn::make('first_name'), | ||
TextColumn::make('last_name'), | ||
TextColumn::make('roles'), | ||
TextColumn::make('account_status'), | ||
TextColumn::make('last_login_at'), | ||
|
||
]) | ||
->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\ListUsers::route('/'), | ||
'create' => Pages\CreateUser::route('/create'), | ||
'edit' => Pages\EditUser::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
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 App\Filament\Resources\UserResource\Pages; | ||
|
||
use App\Filament\Resources\UserResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateUser extends CreateRecord | ||
{ | ||
protected static string $resource = UserResource::class; | ||
} |
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 App\Filament\Resources\UserResource\Pages; | ||
|
||
use App\Filament\Resources\UserResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditUser extends EditRecord | ||
{ | ||
protected static string $resource = UserResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::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,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\UserResource\Pages; | ||
|
||
use App\Filament\Resources\UserResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListUsers extends ListRecords | ||
{ | ||
protected static string $resource = UserResource::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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Widgets\Organizations; | ||
|
||
use Filament\Widgets\StatsOverviewWidget as BaseWidget; | ||
use Filament\Widgets\StatsOverviewWidget\Stat; | ||
|
||
class CaseStatsWidget extends BaseWidget | ||
{ | ||
protected static bool $isLazy = false; | ||
|
||
protected function getStats(): array | ||
{ | ||
return [ | ||
Stat::make(__('beneficiary.stats.open'), 25), | ||
|
||
Stat::make(__('beneficiary.stats.monitoring'), 21), | ||
|
||
Stat::make(__('beneficiary.stats.closed'), 312), | ||
]; | ||
} | ||
} |
Oops, something went wrong.