eminiarts / nova-tabs Goto Github PK
View Code? Open in Web Editor NEWLaravel Nova Tabs Package
Laravel Nova Tabs Package
For MorphToMany Relationship the Tab changes "Attache Resource" button to "Create Resource" then when click create it gives error as explain in #1
When you put all fields into tabs and navigate to the resource detail, then the toolbar doesn't get displayed. i.e. the actions button, edit button and delete buttons are not present. At least one field must be outside of tabs. Also that field cannot be inside a panel either as that also doesn't make the buttons display.
I have a working resource tool but when i setup the tabs, the resource tool title aperas as the tab title and nothing inside.
Code in the resource:
new Tabs('Tabs', [
'Details' => [
ID::make()->sortable(),
Text::make('First name', 'firstName')
->sortable()
->rules('required', 'max:255'),
Text::make('Last name', 'lastName')
->sortable()
->rules('required', 'max:255'),
Text::make('Email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make('Password')
->onlyOnForms()
->creationRules('required', 'string', 'min:6')
->updateRules('nullable', 'string', 'min:6'),
],
'Permissions' => [
NovaUserPermissions::make(),
],
]),
Capture of the tab:
Error in the chrome console:
vendor.js?id=9e34ca4c58232cf1ad19:94149 [Vue warn]: Unknown custom element: <detail-nova-user-permissions> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <DetailTabs>
<LoadingView> at resources/js/components/LoadingView.vue
<Detail> at resources/js/views/Detail.vue
<Root>
Any chance of a dropdown on mobile?
Im using the responsive theme
https://novapackages.com/packages/gregoriohc/laravel-nova-theme-responsive
and the tabs arent really usable
Hi.
I have been trying to create a custom resource-tool (https://nova.laravel.com/docs/2.0/customization/resource-tools.html), and show it on View and Edit tabs using your package, but I only see it on the View tab. I am familiar with this ticket #20 which was preventing the resource tool from appearing on the View tabs, but I am wondering how that fix could allow custom resource-tools to appear on the Edit tabs too.
From looking at the commit in the link above, it appears to only show the Detail vue if the resource-tool's registered name matches the package - if that is so, presumably the Form vue needs a different registration name, otherwise they'd be the same? I hope I'm being clear. When I look at the equivalent code for the Edit tab, (within FormTabs.vue, line 39) it appears to expect the vue to have a 'form-' prefix, like the DetailTabs.vue file had, before it was fixed. I tried renaming my edit form to be prefixed with 'form-', but no joy.
Can someone please help me understand if I'm making a newbie mistake, or if a further commit is needed to FormTabs.vue?
I am using this default registration code to show my resource tool on the 'View' Detail pane:
Nova.booting((Vue, router, store) => { Vue.component('resource-tool-demo', require('./components/Tool')) })
but expected something more like:
Nova.booting((Vue, router, store) => { Vue.component('detail-resource-tool-demo', require('./components/DetailTool')) Vue.component('form-resource-tool-demo', require('./components/FormTool')) })
Thank you.
Hello,
suddenly after updating my composer packages , and tried to open the application
i got error when trying to edit any resource with TabsOnEdit,
i looked at Laravel\Nova\Panel and there is no such method like defaultNameForUpdate
{
"message": "Call to undefined method Laravel\\Nova\\Panel::defaultNameForUpdate()",
"exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\eminiarts\\nova-tabs\\src\\TabsOnEdit.php",
"line": 113,
"trace": [
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Controllers\\UpdateFieldController.php",
"line": 24,
"function": "updateFields",
"class": "App\\Nova\\Setting",
"type": "->"
},
{
"function": "index",
"class": "Laravel\\Nova\\Http\\Controllers\\UpdateFieldController",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php",
"line": 54,
"function": "call_user_func_array"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php",
"line": 45,
"function": "callAction",
"class": "Illuminate\\Routing\\Controller",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
"line": 219,
"function": "dispatch",
"class": "Illuminate\\Routing\\ControllerDispatcher",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php",
"line": 176,
"function": "runController",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
"line": 682,
"function": "run",
"class": "Illuminate\\Routing\\Route",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 30,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Middleware\\Authorize.php",
"line": 18,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Laravel\\Nova\\Http\\Middleware\\Authorize",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Middleware\\BootTools.php",
"line": 20,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Laravel\\Nova\\Http\\Middleware\\BootTools",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Middleware\\DispatchServingNovaEvent.php",
"line": 20,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Auth\\Middleware\\Authenticate.php",
"line": 43,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Middleware\\Authenticate.php",
"line": 31,
"function": "handle",
"class": "Illuminate\\Auth\\Middleware\\Authenticate",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Laravel\\Nova\\Http\\Middleware\\Authenticate",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php",
"line": 41,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php",
"line": 75,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php",
"line": 49,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php",
"line": 63,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Session\\Middleware\\StartSession",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php",
"line": 37,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php",
"line": 66,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 104,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
"line": 684,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
"line": 659,
"function": "runRouteWithinStack",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
"line": 625,
"function": "runRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php",
"line": 614,
"function": "dispatchToRoute",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
"line": 176,
"function": "dispatch",
"class": "Illuminate\\Routing\\Router",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 30,
"function": "Illuminate\\Foundation\\Http\\{closure}",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\nova\\src\\Http\\Middleware\\ServeNova.php",
"line": 26,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Laravel\\Nova\\Http\\Middleware\\ServeNova",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\fideloper\\proxy\\src\\TrustProxies.php",
"line": 57,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Fideloper\\Proxy\\TrustProxies",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
"line": 31,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php",
"line": 31,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php",
"line": 27,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php",
"line": 62,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 163,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Pipeline.php",
"line": 53,
"function": "Illuminate\\Pipeline\\{closure}",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php",
"line": 104,
"function": "Illuminate\\Routing\\{closure}",
"class": "Illuminate\\Routing\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
"line": 151,
"function": "then",
"class": "Illuminate\\Pipeline\\Pipeline",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php",
"line": 116,
"function": "sendRequestThroughRouter",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\public\\index.php",
"line": 55,
"function": "handle",
"class": "Illuminate\\Foundation\\Http\\Kernel",
"type": "->"
},
{
"file": "E:\\Laravel\\Paymint\\latest\\server.php",
"line": 21,
"function": "require_once"
}
]
}
Using $this->mergeWhen($condition, $value)
when condition is false is returning a new instance of Illuminate\Http\Resources\MissingValue and that's when Tabs is failing returning this error:
Call to undefined method Illuminate\Http\Resources\MissingValue::withMeta()
I guess, we should check the type of the fields returning on each tab content (or relations)
Hello,
I noticed this package has code from dkulyk/nova-tabs. I have some concerns regarding the license. Perhaps it should also be more prominently visible that this package was sort of built on top of @dkulyk's implementation.
What are your thoughts?
The trait TabsOnEdit
overwrite both fill
and fillForUpdate
methods but instead of calling
creationFieldsWithoutReadonly
or updateFieldsWithoutReadonly
they call creationFields
or updateFields
directly.
Nova's default behaviour from the trait FillsField
is to exclude the readonly fields from the FieldCollection.
return static::fillFields(
$request, $model,
(new static($model))->creationFieldsWithoutReadonly($request)
);
where creationFieldsWithoutReadonly
calls creationFields
.
The trait TabsOnEdit
calls creationFields
directly
public static function fill(NovaRequest $request, $model)
{
return static::fillFields(
$request, $model,
(new static($model))->parentCreationFields($request)
);
}
public function parentCreationFields(NovaRequest $request)
{
return parent::creationFields($request);
}
What is the reason behind this I'm not seeing?
So the implementation of fill
and fillForUpdate
in the TabsOnEdit
trait only skips calling *FieldsWithoutReadonly
. If I remove the fill
and fillForUpdate
overwrites from the TabsOnEdit
trait, everything seems to work just fine.
Can we add condition per tab which can be hidden/shown based on condition e.g. user role?
Hi,
Upon updating your package today, my tab content became hidden.
I fixed it by changing my composer.json
and going back to version 0.3.0
.
Hello Im using nova v 2.1.0 but when im tried to install this package using composer it goes like this
Using version ^1.1 for eminiarts/nova-tabs
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for eminiarts/nova-tabs ^1.1 -> satisfiable by eminiarts/nova-tabs[1.1.0].
- eminiarts/nova-tabs 1.1.0 requires laravel/nova ^2.1.0 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
Hi, me again :)
Thanks for the amazing work on d678a7f
I just have a little enhanced me here as well. On detail view, i can have fields outside the tabs, those shows me for instance on top of the panel. but on update, it collect it to the tabs and put it in an empty register.
It would be awesome when it would be separated in the update view as well.
Thanks and best wishes,
Simon
Found another issue, not sure why this happens, the only difference I can find is that it works in Car.php but not CarSeat.php, so the compound name, otherwise the two files are identical.
TabsPanel has undefined group names, which results in:
[Vue warn]: Unknown custom element: <detail-undefined> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
found in
---> <DetailTabs> at resources/js/components/Tabs.vue
<TabsPanel> at resources/js/components/TabsPanel.vue
<LoadingView> at resources/js/components/LoadingView.vue
<Detail> at resources/js/views/Detail.vue
<Root>
The code for that is:
(new TabsPanel(__('List name'), [
Tabs::make()
->addTab(__('Details'), [
Text::make('Title', 'title'),
])
->addTab(__('v'), HasMany::make('Values', 'values', ListValue::class)),
]))->withToolbar(),
Originally posted by @JapSeyz in #7 (comment)
Hi
Thanks for your work!
Can you make that the tabs keep displaying on edit view? Now it's beautiful tabbed on detail view but on edit, it's all listed.
Would be great!
In TabsOnEdit.php
2 function are used from Panel class, which are removed in latest Nova version
Panel::defaultNameForCreate
and Panel::defaultNameForUpdate
New function is added to Panel, which is merging these functions
Panel::defaultNameFor
2 function should be updated
public function updateFields(NovaRequest $request)
{
return collect(
[
'Tabs' => [
'component' => 'tabs',
'fields' => $this->removeNonUpdateFields($this->resolveFields($request)),
'panel' => Panel::defaultNameForUpdate($request->newResource()),
],
]
)
and
public function creationFields(NovaRequest $request)
{
return collect(
[
'Tabs' => [
'component' => 'tabs',
'fields' => $this->removeNonCreationFields($this->resolveFields($request)),
'panel' => Panel::defaultNameForCreate($request->newResource()),
],
]
);
}
When i upgrade to nova 2.0.8, in the edit view have this error:
{
"message": "Trying to get property 'panel' of non-object",
"exception": "ErrorException",
"file": "/dev.nova.com/vendor/laravel/nova/src/ResolvesFields.php",
"line": 518,
"trace": [
//...
Hi,
I've just found your package. Great work!
It seems that there is a problem with filters, when I have two tabs with different relations:
(new TabsPanel('Project Details', [
Tabs::make()
->addTab('Applications', HasMany::make('Applications'))
->addTab('Information', [
// other fields
])
->addTab('Instruments', HasMany::make('Instruments')),
]))->withToolbar(),
];
My Nova resource 'Application' has a filter, 'Instrument' does not have one. After loading the TabsPanel I get this error. Also the filter button is not displayed.
I can get the filter button back when I refresh the page (F5) but my filter is displayed on both relationship tabs then.
Hi,
Whenever you fill all the required fields in a tab, but another tab has a required field that is not filled, there is no indication of why nothing is happening upon clicking the 'Create {model}' button. From an end user perspective this can be rather frustrating.
Sample video demonstrating the behaviour:
No indication of missing required fields upon creating
Jumping to the first tab in which a field is missing seems like the ideal behaviour.
Apologies if i missed something in the documentation!
P.S. Thanks for your effort on creating this plugin, makes the user experience lot better.
Hey
This is 2 reports in 1, since they are connected.
As you can see from the screen above, if i have one result the filters get's cut out and i need to scroll that list but while that might work, the last filter is almost unreachable.
Another problem is if have many tabs and i have filters with only one result (same as above) this time i can't scroll it.
Not sure if that's easily fixable, but that's a bug regardless.
Not sure why this happens.
I have a Client Resource with a relationship and actions:
But when I visit Invoices (everything works fine) and then Actions, the Filter on Invoices disappear, even though I only hide the fields.
Looking at Actions -> Invoices -> Actions -> Invoices works.
Visiting Invoices -> Actions -> Invoices fails.
If anyone know why, any help would be much appreciated!
I got this error when using Nova 2.10 and nova-tabs v.1.0.6
Argument 1 passed to Laravel\Nova\Resource::removeNonCreationFields() must be an instance of Laravel\Nova\Http\Requests\NovaRequest, instance of Laravel\Nova\Fields\FieldCollection given, called in /path/vendor/eminiarts/nova-tabs/src/TabsOnEdit.php on line 22
I have a basic hasMany relationship attached to one of my models when I select create resource, I get a 404 error on the network tab.
Soon as I remove your tabbed field, it works fine.
Plugin awesome apart from that.
{ "message": "", "exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException", "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Application.php", "line": 940, "trace": [ { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php", "line": 46, "function": "abort", "class": "Illuminate\\Foundation\\Application", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Controllers/FieldController.php", "line": 22, "function": "abort" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Support/helpers.php", "line": 1138, "function": "Laravel\\Nova\\Http\\Controllers\\{closure}", "class": "Laravel\\Nova\\Http\\Controllers\\FieldController", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Support/Arr.php", "line": 180, "function": "value" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Support/Collection.php", "line": 732, "function": "first", "class": "Illuminate\\Support\\Arr", "type": "::" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Fields/FieldCollection.php", "line": 21, "function": "first", "class": "Illuminate\\Support\\Collection", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Controllers/FieldController.php", "line": 23, "function": "findFieldByAttribute", "class": "Laravel\\Nova\\Fields\\FieldCollection", "type": "->" }, { "function": "show", "class": "Laravel\\Nova\\Http\\Controllers\\FieldController", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Controller.php", "line": 54, "function": "call_user_func_array" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 212, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 169, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 682, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Middleware/Authorize.php", "line": 18, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\Authorize", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Middleware/BootTools.php", "line": 20, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\BootTools", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php", "line": 20, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php", "line": 43, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Middleware/Authenticate.php", "line": 31, "function": "handle", "class": "Illuminate\\Auth\\Middleware\\Authenticate", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\Authenticate", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php", "line": 41, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php", "line": 75, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php", "line": 49, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", "line": 63, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php", "line": 66, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 104, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 684, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 659, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 625, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 614, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 176, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/nova/src/Http/Middleware/ServeNova.php", "line": 26, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\ServeNova", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php", "line": 58, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Barryvdh\\Debugbar\\Middleware\\InjectDebugbar", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/fideloper/proxy/src/TrustProxies.php", "line": 57, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Fideloper\\Proxy\\TrustProxies", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 31, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 31, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php", "line": 27, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php", "line": 62, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 151, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 104, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 151, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/nova/public/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 116, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/nova/public/public/index.php", "line": 55, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }
Hi, Is it possible to allow one Tab with Relations showing more than 5 Resources per Page?
Im working on a project where i almost always have between 5-10 Resources and i'd like to have them on the same page.
Hello,
Is it possible to remember the current tab when editing a resource. When clicking "Update & Continue Editing" it always goes back to the first tab which would be frustrating for users.
Great work!!
Could you please add overflow-x-auto.
For wide tabs on tablets and smaller devices it is impossible to reach tabs that grows out of the view.
Also the search field overlaps the tab titles,
(don't have a suggestion for how to solve that at the moment :)
<div class="relationship-tabs-panel card overflow-hidden overflow-x-auto">
If I have tab with relation which denied by policy page will shown 403.
Need to filter denied fields in tab and hide empty tabs.
When you use the edittab option and the form validation fails it would be nice that you can see that there is an error on a field inside a tab.
After upgrading nova to 2.0.9, all form fields have disappeared.
When I tried to unuse 'TabsOnEdit' trait, all fields appeared.
laravel: 7.8.30
nova: 2.0.9
nova-tabs: 1.0.5
Using Nova 2.0.9 or 2.0.8 & the latest version of nova-tabs (with the tabsOnEdit fix).
When I try to created a resource I get a blank page (only the action buttons), with no error in my console.
When I try to view a resource I get TypeError: Cannot set property 'fields' of undefined
error
The edit view is working perfectly though
Last working setup:
nova 2.0.7 + nova-tabs 1.0.4
Hey,
I can't figure out out to create a tab-panel with tabs for both regular fields and relations, eg:
| Details | Meta | Cars (Relation) | Driver ( Relation |
I can create one panel via new TabsPanel with regular fields, and relationships via Tabs::make, but if I try to add one to the either, it fails.
Is there a smart way to add the relationship tabs to the TabsPanel?
Cheers,
Nice package, discussions were had here tighten/nova-package-development#54
Just wanted to drop this layout here incase it's something you'd consider
Nova Tabs: 1.0.4
Nova: 1.3.1
Laravel: 5.7.7
Mixing fields and relations in a single tab (as mentioned in #7 ) appears to no longer work since 1.0.
Using the documented syntax breaks the relation into their own tab regardless of what else is in the defined tab, and using the addTab
syntax detailed in #7 results in a Only listable fields or Panel allowed.
error.
Hi,
I have this code but the resources title is not display at the top of the page, do you know why?
This is my code. I appreciate any help.
public function fields(Request $request)
{
$options = [];
$options = [
'Pending' => 'Pending',
'Assigned' => 'Assigned',
'Expired' => 'Expired',
'Cancelled' => 'Cancelled',
];
return [
(new Tabs(__('Load Order Details'), [
new Panel(__('General'),[
ID::make()->sortable(),
Text::make(__('Load Order')),
Text::make(__('From')),
Text::make(__('To')),
DateTime::make(__('PickUp Date')),
Text::make(__('Expires In'))->resolveUsing(function($date) {
$expireDate = Carbon::parse(date($date));
$format = Carbon::ONE_DAY_WORDS;
return $expireDate->diffForHumans(now(), ['options' => $format]);
})
->hideWhenCreating()
->hideWhenUpdating()
->sortable(),
DateTime::make(__('Expires Date'), 'expires_in')
->hideFromIndex()
->format('ddd, MMM Do YYYY - h:mm a')
->rules('required')
->sortable(),
Select::make(__('Status'))
->options($options),
Boolean::make(__('Active')),
]),
new Panel(__('Weight and Pieces'),[
Number::make(__('Weight'))
->hideFromIndex()
->required(),
Text::make(__('Unit Of Measure'))
->hideFromIndex()
->required(),
Number::make(__('Pieces'))
->hideFromIndex()
->required(),
]),
new Panel(__('Package Information'),[
Select::make(__('Package Type'))
->hideFromIndex()
->required()
->options([
'No Package' => 'No Package',
'Box' => 'Box',
'Container' => 'Container'
]),
Number::make(__('Package Width'))
->hideFromIndex()
->required(),
Number::make(__('Package Length'))
->hideFromIndex()
->required(),
Number::make(__('Package Height'))
->hideFromIndex()
->required(),
]),
new Panel(__('Comments'),[
Textarea::make(__('Description of Items to Pickup'), 'desc_items_pickup')
->alwaysShow()
->rows(8)
->hideFromIndex()
->required(),
Textarea::make(__('Observations'))
->alwaysShow()
->rows(8)
->hideFromIndex()
->required(),
// $table->integer('dispatcher_id');
// $table->integer('user_id');
]),
])),
];
}
When viewing a resource, the action-menu to edit/delete the resource is gone when using only tabs.
public function fields(Request $request)
{
return [
//...
Tabs::make('Relations')
->addTab(
__('Ssl Certificates'),
BelongsToMany::make('Ssl Certificates', 'ssl_certificates', SslCertificate::class)
->searchable()
)
//...
];
}
Causes "Trying to get property 'resourceClass' of non-object" exception when trying to attach a Ssl Certificate, but when I move the BelongsToMany outside of the Tab everything works:
public function fields(Request $request)
{
return [
//...
Tabs::make('Relations')
//...
BelongsToMany::make('Ssl Certificates', 'ssl_certificates', SslCertificate::class)
->searchable()
];
}
@bajramemini There's a small issue with it in ResolvesFields, since it no longer respects ->hideFromDetail(), as the $field in the call resolves to the Tab, ignoring every field inside of the Tab
Originally posted by @JapSeyz in #7 (comment)
When trying to delete an image the URL the delete call is made to does not include the correct resource id.
As an example, the call is made to
/nova-api/products/undefined/field/image
where undefined
should be replaced with the resource ID.
Hey.
I have these two fields:
Country::make('Country')->onlyOnForms(),
....
...
...
Text::make('Country')->exceptOnForms(),
Because the Form location and the detail location for the country is different - However it seems to clash and just default to Undefined in the JS.
** Step to reproduce **
/**
* Get the fields displayed by the resource.
*
* @param \Illuminate\Http\Request $request
*
* @return array
*/
public function fields(Request $request)
{
return [
new Tabs('Tabs', [
'One' => [
Text::make('youzan_client_secret')->hideFromIndex()->rules('required'),
],
'Two' => [
Code::make('Json', 'meta')->json(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)->rules('required'),
],
]),
];
}
When I change to tab Two, the Json code field is empty, but when i click to focus, the content is back.
I can't get the tabs visible in my has many pivot form. Is this not possible or am I failing?
public function fields(Request $request)
{
return [
(new Tabs('Tabs', [
'General' => [
ID::make()
->sortable(),
Text::make('Title'),
BelongsTo::make('Category')
->searchable(),
BelongsToMany::make('Platforms')
->fields(function () {
return [
(new Tabs('PivotTabs', [
'General' => [
Currency::make('Price'),
],
'Content' => [
Trix::make('Description')
->alwaysShow()
->nullable()
->hideFromIndex()
->withFiles('public'),
]
])),
];
}),
AttachMany::make('Platforms'),
],
]))->withToolbar(),
];
}
I have a BelongsTo field on a model and trying to create it from related parent.
public function fields(Request $request)
{
return [
new Tabs('Tabs', [
'Basic' => [
BelongsTo::make('Company'),
]),
];
}
It is populated by relation model and disabled.
But if I add
use TabsOnEdit;
To a model, it becomes not populated by relation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.