Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit 9ac0fb6

Browse files
Update form and infolist schemas with Livewire resources
1 parent 4268213 commit 9ac0fb6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Concerns/Resources/InteractsWithSchemas.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,33 @@
22

33
namespace CodeWithDennis\FilamentTests\Concerns\Resources;
44

5+
use Filament\Resources\Pages\EditRecord;
6+
use Filament\Resources\Pages\ViewRecord;
57
use Filament\Schemas\Schema;
68

79
trait InteractsWithSchemas
810
{
911
public function getResourceForm(): Schema
1012
{
11-
return $this->getResource()->form(new Schema);
13+
return $this->getResource()->form(new Schema(
14+
app('livewire')->new(EditRecord::class)
15+
));
1216
}
1317

1418
public function getResourceInfolist(): Schema
1519
{
16-
return $this->getResource()->infolist(new Schema);
20+
return $this->getResource()->infolist(new Schema(
21+
app('livewire')->new(ViewRecord::class)
22+
));
1723
}
1824

1925
public function getResourceInfolistFields(): array
2026
{
21-
return $this->getResourceInfolist()->getFlatFields();
27+
return $this->getResourceInfolist()->getFlatFields(true);
2228
}
2329

2430
public function getResourceFormFields(): array
2531
{
26-
return $this->getResourceForm()->getFlatFields();
32+
return $this->getResourceForm()->getFlatFields(true);
2733
}
2834
}

0 commit comments

Comments
 (0)