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

Commit 7dcbd9c

Browse files
Resolve conflicts
1 parent 4e8d3bc commit 7dcbd9c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/Concerns/InteractsWithResources.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
namespace CodeWithDennis\FilamentTests\Concerns;
44

5-
use Filament\Resources\Resource;
6-
use Illuminate\Database\Eloquent\Model;
5+
use Filament\Schemas\Schema;
76

87
trait InteractsWithResources
98
{
10-
/** @return class-string<resource>|null */
119
public function getResourceClass(): ?string
1210
{
1311
return $this->resourceClass;
1412
}
1513

16-
/** @return class-string<Model>|null */
14+
public function getResource()
15+
{
16+
return new ($this->getResourceClass());
17+
}
18+
1719
public function getResourceModel(): ?string
1820
{
19-
/** @var class-string<resource>|null $resource */
20-
$resource = $this->getResourceClass();
21+
return $this->getResource()->getModel();
22+
}
2123

22-
return $resource ? $resource::getModel() : null;
24+
public function getResourceForm()
25+
{
26+
return $this->getResource()->form(new Schema);
2327
}
2428
}

0 commit comments

Comments
 (0)