diff --git a/composer.lock b/composer.lock index 40040472..c1ede7d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d129f56fbbd7e588ed7ef053d0decec6", + "content-hash": "071fb01058129c4f15c0ce410df361d3", "packages": [ { "name": "alperenersoy/filament-export", @@ -13000,16 +13000,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -13019,11 +13019,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -13076,7 +13076,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-01-11T20:47:48+00:00" }, { "name": "symfony/cache", diff --git a/routes/web.php b/routes/web.php index 943c1402..8b8e7cc6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -21,6 +21,11 @@ ->name('entry.show') ->middleware('auth'); + if (class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class)) { + Route::get('embed/{slug}', \LaraZeus\BoltPro\Livewire\EmbedForm::class) + ->name('form.embed'); + } + Route::get('{slug}/{extensionSlug?}', FillForms::class) ->name('form.show'); }); diff --git a/src/Concerns/Schemata.php b/src/Concerns/Schemata.php index b4f0a193..3cf602f3 100644 --- a/src/Concerns/Schemata.php +++ b/src/Concerns/Schemata.php @@ -299,21 +299,6 @@ public static function getTabsSchema(): array }), ]), - Tabs\Tab::make('embed-tab') - ->label(__('Embed')) - ->visible(fn ( - string $operation - ): bool => class_exists(\LaraZeus\Sky\SkyServiceProvider::class) && $operation === 'edit') - ->schema([ - TextInput::make('form_embed') - ->label(__('to embed the form in any post or page')) - ->dehydrated(false) - ->disabled() - ->formatStateUsing(function (Get $get) { - return '' . $get('slug') . ''; - }), - ]), - Tabs\Tab::make('design') ->label(__('Design')) ->visible(class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class) && config('zeus-bolt.allow_design')) diff --git a/src/Filament/Resources/FormResource.php b/src/Filament/Resources/FormResource.php index a968e894..df378cc1 100644 --- a/src/Filament/Resources/FormResource.php +++ b/src/Filament/Resources/FormResource.php @@ -188,6 +188,8 @@ public static function getPages(): array if (class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class)) { //@phpstan-ignore-next-line $pages['prefilled'] = \LaraZeus\BoltPro\Livewire\PrefilledForm::route('/{record}/prefilled'); + //@phpstan-ignore-next-line + $pages['share'] = \LaraZeus\BoltPro\Livewire\ShareForm::route('/{record}/share'); } return $pages; @@ -256,11 +258,24 @@ public static function getActions(): array public static function getRecordSubNavigation(Page $page): array { - return $page->generateNavigationItems([ + $formNavs = [ Pages\ViewForm::class, Pages\EditForm::class, + ]; + + if (class_exists(\LaraZeus\BoltPro\BoltProServiceProvider::class)) { + //@phpstan-ignore-next-line + $formNavs[] = \LaraZeus\BoltPro\Livewire\ShareForm::class; + } + + $respNavs = [ Pages\ManageResponses::class, Pages\BrowseResponses::class, + ]; + + return $page->generateNavigationItems([ + ...$formNavs, + ...$respNavs, ]); } }