-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
f548873
commit 693a2b9
Showing
7 changed files
with
123 additions
and
43 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
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,32 @@ | ||
<?php | ||
|
||
namespace SolutionForest\FilamentFieldGroup\Concerns; | ||
|
||
trait HasFieldTypes | ||
{ | ||
protected array $fieldTypeConfigs = [ | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Text::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\TextArea::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Email::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Password::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Number::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Url::class, | ||
\SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Select::class, | ||
]; | ||
|
||
public function fieldTypeConfigs(array $fieldTypeConfigs, bool $override = true): static | ||
{ | ||
if ($override) { | ||
$this->fieldTypeConfigs = $fieldTypeConfigs; | ||
} else { | ||
$this->fieldTypeConfigs = array_merge($this->fieldTypeConfigs, $fieldTypeConfigs); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
public function getFieldTypeConfigs(): array | ||
{ | ||
return $this->fieldTypeConfigs; | ||
} | ||
} |
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,33 @@ | ||
<?php | ||
|
||
namespace SolutionForest\FilamentFieldGroup\Concerns; | ||
|
||
use SolutionForest\FilamentFieldGroup\Filament\Resources\FieldGroupResource; | ||
|
||
trait HasFilamentResources | ||
{ | ||
protected array $resources = [ | ||
FieldGroupResource::class, | ||
]; | ||
|
||
public function resources(array $resources, bool $override = true): static | ||
{ | ||
if ($override) { | ||
$this->resources = $resources; | ||
} else { | ||
$this->resources = array_merge($this->resources, $resources); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
public function overrideResources(array $resources): static | ||
{ | ||
return $this->resources($resources); | ||
} | ||
|
||
public function getFilamentResources(): array | ||
{ | ||
return $this->resources; | ||
} | ||
} |
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
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