Skip to content

Commit 969cdd0

Browse files
committed
wip
1 parent 73b9083 commit 969cdd0

20 files changed

Lines changed: 23851 additions & 771 deletions

File tree

.env.ci

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
APP_ENV=ci
2+
APP_KEY=
3+
APP_DEBUG=true
4+
APP_URL=http://localhost
5+
6+
LOG_CHANNEL=stack
7+
LOG_LEVEL=debug
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_DATABASE=tests
12+
DB_USERNAME=root
13+
DB_PASSWORD=
14+
15+
BROADCAST_DRIVER=log
16+
CACHE_DRIVER=file
17+
FILESYSTEM_DISK=local
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
21+
MAIL_MAILER=log

.github/workflows/tests.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,24 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
php-version:
14-
- "8.2"
14+
- "8.4"
1515

1616
env:
17-
extensions: mbstring, sqlite, intl, gd
17+
extensions: mbstring, pdo, pdo_mysql, intl, gd
18+
19+
services:
20+
mysql:
21+
image: mysql:8
22+
env:
23+
MYSQL_DATABASE: tests
24+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
25+
ports:
26+
- 3306/tcp
27+
options: >-
28+
--health-cmd "mysqladmin ping"
29+
--health-interval 10s
30+
--health-timeout 5s
31+
--health-retries 3
1832
1933
steps:
2034
- name: Checkout
@@ -41,7 +55,6 @@ jobs:
4155
php-version: ${{ matrix.php-version }}
4256
extensions: ${{ env.extensions }}
4357
coverage: pcov
44-
tools: composer:v2
4558

4659
- name: Get composer cache directory
4760
id: composercache
@@ -59,8 +72,10 @@ jobs:
5972

6073
- name: Setup env
6174
run: |
62-
cp .env.example .env
75+
cp .env.ci .env
6376
php artisan key:generate --ansi
6477
6578
- name: Run tests
6679
run: php artisan test
80+
env:
81+
DB_PORT: ${{ job.services.mysql.ports[3306] }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ Homestead.json
2828
Homestead.yaml
2929
npm-debug.log
3030
phpstan.neon
31-
phpunit.xml
3231
yarn-error.log
3332
.DS_Store

.valetrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
php=php@8.2
1+
php=php@8.4

app/Filament/Resources/UserResource/Concerns/ResolvesRecord.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ trait ResolvesRecord
1212

1313
public function getPageUrl(string $name): string
1414
{
15-
return UserResource::getUrl($name, $this->getRecord());
15+
return UserResource::getUrl($name, [
16+
'record' => $this->getRecord(),
17+
]);
1618
}
1719
}

app/Filament/Resources/UserResource/Pages/Nurse/ViewGeneral.php

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,15 @@
44

55
namespace App\Filament\Resources\UserResource\Pages\Nurse;
66

7-
use App\Forms\Components\FileList;
8-
use App\Forms\Components\Location;
9-
use App\Forms\Components\Subsection;
10-
use App\Forms\Components\Value;
11-
use Filament\Forms\Form;
7+
use App\Filament\Resources\ProfileResource\Schemas\GeneralInfolist;
8+
use Filament\Infolists\Infolist;
129

1310
class ViewGeneral extends ViewRecord
1411
{
15-
public function form(Form $form): Form
12+
public function infolist(Infolist $infolist): Infolist
1613
{
17-
return $form
18-
->columns(1)
19-
->schema([
20-
Subsection::make()
21-
->icon('heroicon-o-user')
22-
->columns(2)
23-
->schema([
24-
Value::make('first_name')
25-
->label(__('field.first_name')),
26-
27-
Value::make('last_name')
28-
->label(__('field.last_name')),
29-
30-
Value::make('date_of_birth')
31-
->label(__('field.date_of_birth')),
32-
33-
Value::make('gender')
34-
->label(__('field.gender')),
35-
36-
Value::make('cnp')
37-
->label(__('field.cnp')),
38-
]),
39-
40-
Subsection::make()
41-
->icon('heroicon-o-map-pin')
42-
->columns(2)
43-
->schema([
44-
Location::make(),
45-
Value::make('email')
46-
->label(__('field.email')),
47-
48-
Value::make('phone')
49-
->label(__('field.phone')),
50-
]),
51-
52-
Subsection::make()
53-
->icon('heroicon-o-document')
54-
->columns(2)
55-
->schema([
56-
Value::make('accreditation_number')
57-
->label(__('field.accreditation_number')),
58-
59-
Value::make('accreditation_date')
60-
->label(__('field.accreditation_date')),
61-
62-
FileList::make('accreditation_document')
63-
->label(__('field.accreditation_document'))
64-
->collection('accreditation_document')
65-
->columnSpanFull(),
66-
]),
67-
]);
14+
return $infolist
15+
->schema(GeneralInfolist::getSchema());
6816
}
6917

7018
public function getRelationManagers(): array

app/Filament/Resources/UserResource/Pages/Nurse/ViewRecord.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
use App\Filament\Resources\UserResource\Actions\DeactivateUserAction;
1313
use App\Filament\Resources\UserResource\Actions\ResendInvitationAction;
1414
use App\Filament\Resources\UserResource\Concerns;
15+
use App\Models\User;
1516
use Filament\Actions\DeleteAction;
1617
use Filament\Actions\EditAction;
1718
use Filament\Resources\Pages\ViewRecord as BaseViewRecord;
1819

19-
class ViewRecord extends BaseViewRecord implements WithTabs
20+
abstract class ViewRecord extends BaseViewRecord implements WithTabs
2021
{
2122
use HasTabs;
2223
use Concerns\ResolvesRecord;
@@ -34,8 +35,8 @@ protected function getHeaderActions(): array
3435

3536
EditAction::make()
3637
->icon('heroicon-s-pencil')
37-
->url(fn ($record) => UserResource::getUrl($name, $record))
38-
->visible(fn ($record) => auth()->user()->can('update', $record)),
38+
->url(fn (User $record) => UserResource::getUrl($name, ['record' => $record]))
39+
->visible(fn (User $record) => auth()->user()->can('update', $record)),
3940

4041
ActivateUserAction::make()
4142
->record($this->getRecord()),

app/Providers/FilamentServiceProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function register(): void
3232
{
3333
$this->setDateTimeDisplayFormats();
3434

35+
$this->configureInfolistComponents();
3536
$this->configurePages();
3637
}
3738

@@ -43,6 +44,13 @@ public function boot(): void
4344
//
4445
}
4546

47+
protected function configureInfolistComponents(): void
48+
{
49+
Infolists\Components\TextEntry::configureUsing(function (Infolists\Components\TextEntry $entry) {
50+
// return $entry->default('—');
51+
});
52+
}
53+
4654
protected function configurePages(): void
4755
{
4856
Page::alignFormActionsEnd();

composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"commitglobal/enum-utils": "^v1.0",
1414
"filament/filament": "^3.2",
1515
"filament/spatie-laravel-media-library-plugin": "^3.2",
16-
"guzzlehttp/guzzle": "^7.9",
16+
"guzzlehttp/guzzle": "^7.10",
1717
"jeffgreco13/filament-breezy": "^2.6",
1818
"kalnoy/nestedset": "^6.0",
1919
"laravel/framework": "^11.45",
@@ -42,7 +42,9 @@
4242
"laravel/telescope": "^5.11",
4343
"mockery/mockery": "^1.6",
4444
"nunomaduro/collision": "^8.5",
45-
"phpunit/phpunit": "^10.5",
45+
"pestphp/pest": "^4.0",
46+
"pestphp/pest-plugin-laravel": "^4.0",
47+
"pestphp/pest-plugin-livewire": "^4.0",
4648
"spatie/laravel-ignition": "^2.9"
4749
},
4850
"autoload": {
@@ -92,7 +94,10 @@
9294
"config": {
9395
"optimize-autoloader": true,
9496
"preferred-install": "dist",
95-
"sort-packages": true
97+
"sort-packages": true,
98+
"allow-plugins": {
99+
"pestphp/pest-plugin": true
100+
}
96101
},
97102
"minimum-stability": "stable",
98103
"prefer-stable": true

0 commit comments

Comments
 (0)