-
-
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
21 changed files
with
563 additions
and
17 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,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns; | ||
|
||
enum AggressorLegalHistory: string | ||
{ | ||
use Concerns\Enums\Arrayable; | ||
use Concerns\Enums\Comparable; | ||
use Concerns\Enums\HasLabel; | ||
|
||
case CRIMES = 'crimes'; | ||
case CONTRAVENTIONS = 'contraventions'; | ||
case PROTECTION_ORDER = 'protection_order'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.aggressor_legal_history'; | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns; | ||
|
||
enum AggressorRelationship: string | ||
{ | ||
use Concerns\Enums\Arrayable; | ||
use Concerns\Enums\Comparable; | ||
use Concerns\Enums\HasLabel; | ||
|
||
case MARITAL = 'marital'; | ||
case CONSENSUAL = 'consensual'; | ||
case FORMER_PARTNER = 'former_partner'; | ||
case PARENTAL = 'parental'; | ||
case FILIAL = 'filial'; | ||
case OTHER_RELATED = 'other_related'; | ||
case OTHER = 'other'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.aggressor_relationship'; | ||
} | ||
} |
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\Enums; | ||
|
||
use App\Concerns; | ||
|
||
enum Drug: string | ||
{ | ||
use Concerns\Enums\Arrayable; | ||
use Concerns\Enums\Comparable; | ||
use Concerns\Enums\HasLabel; | ||
|
||
case ALCOHOL_OCCASIONAL = 'alcohol_occasional'; | ||
case ALCOHOL_FREQUENT = 'alcohol_frequent'; | ||
case TOBACCO = 'tobacco'; | ||
case TRANQUILIZERS = 'tranquilizers'; | ||
case DRUGS = 'drugs'; | ||
case OTHER = 'other'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.drug'; | ||
} | ||
} |
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Enums; | ||
|
||
use App\Concerns; | ||
|
||
enum Violence: string | ||
{ | ||
use Concerns\Enums\Arrayable; | ||
use Concerns\Enums\Comparable; | ||
use Concerns\Enums\HasLabel; | ||
|
||
case VERBAL = 'verbal'; | ||
case PSYCHOLOGICAL = 'psychological'; | ||
case PHYSICAL = 'physical'; | ||
case SEXUAL = 'sexual'; | ||
case ECONOMIC = 'economic'; | ||
case SOCIAL = 'social'; | ||
case SPIRITUAL = 'spiritual'; | ||
case CYBER = 'cyber'; | ||
case DEPRIVATION = 'deprivation'; | ||
|
||
protected function labelKeyPrefix(): ?string | ||
{ | ||
return 'enum.violence'; | ||
} | ||
} |
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\Admin\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
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,64 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Models; | ||
|
||
use App\Concerns\HasCitizenship; | ||
use App\Enums\AggressorLegalHistory; | ||
use App\Enums\AggressorRelationship; | ||
use App\Enums\CivilStatus; | ||
use App\Enums\Drug; | ||
use App\Enums\Gender; | ||
use App\Enums\Occupation; | ||
use App\Enums\Studies; | ||
use App\Enums\Ternary; | ||
use App\Enums\Violence; | ||
use Illuminate\Database\Eloquent\Casts\AsEnumCollection; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
class Aggressor extends Model | ||
{ | ||
use HasCitizenship; | ||
use HasFactory; | ||
|
||
protected $fillable = [ | ||
'age', | ||
'civil_status', | ||
'drugs', | ||
'has_drug_history', | ||
'has_protection_order', | ||
'has_psychiatric_history', | ||
'has_violence_history', | ||
'legal_history', | ||
'occupation', | ||
'protection_order_notes', | ||
'psychiatric_history_notes', | ||
'relationship', | ||
'studies', | ||
'violence_types', | ||
]; | ||
|
||
protected $casts = [ | ||
'age' => 'integer', | ||
'civil_status' => CivilStatus::class, | ||
'drugs' => AsEnumCollection::class . ':' . Drug::class, | ||
'gender' => Gender::class, | ||
'has_drug_history' => Ternary::class, | ||
'has_protection_order' => Ternary::class, | ||
'has_psychiatric_history' => Ternary::class, | ||
'has_violence_history' => Ternary::class, | ||
'legal_history' => AsEnumCollection::class . ':' . AggressorLegalHistory::class, | ||
'occupation' => Occupation::class, | ||
'relationship' => AggressorRelationship::class, | ||
'studies' => Studies::class, | ||
'violence_types' => AsEnumCollection::class . ':' . Violence::class, | ||
]; | ||
|
||
public function beneficiary(): BelongsTo | ||
{ | ||
return $this->belongsTo(Beneficiary::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
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
Oops, something went wrong.