-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow extending of page edit record forms (#1938)
This PR adds the ability to extend base edit record pages. Our use case is the ability to add to the inventory pages, which is why I've applied this to them. --------- Co-authored-by: Author <[email protected]>
- Loading branch information
1 parent
613e597
commit fd3008b
Showing
5 changed files
with
22 additions
and
2 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
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
18 changes: 18 additions & 0 deletions
18
packages/admin/src/Support/Pages/Concerns/ExtendsForms.php
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 | ||
|
||
namespace Lunar\Admin\Support\Pages\Concerns; | ||
|
||
use Filament\Forms\Form; | ||
|
||
trait ExtendsForms | ||
{ | ||
public function form(Form $form): Form | ||
{ | ||
return self::callLunarHook('extendForm', $this->getDefaultForm($form)); | ||
} | ||
|
||
public function getDefaultForm(Form $form): Form | ||
{ | ||
return $form; | ||
} | ||
} |