question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Attributes in pivot tables

See original GitHub issue

Bug report

What I did

Trying to create Attach/Detach between two entities connected with M:N relation (pivot table has additional attributes).

I’ve tried couple of different field types (select2_multiple, select_multiple), i even tried to create repeatable field.

Having attributes in pivot tables is like really common (don’t recall project when i didn’t have this)…

What I expected to happen

To be able to specify pivot attributes for each entity i select in select2_multiple, or to have a way to add some custom button with modal where you can attach relation with some additional attrbutes.

What happened

When i was using select_multiple or select2_multiple, additional fields were not showing and application was throwing exceptions (as expected).

When i was trying to use repeatable, data sent to server was in json format, and syncPivot method wasn’t well coded to handle this.

What I’ve already tried to fix it

I’ve just tried different field types.

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

PHP VERSION:

PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:46) ( ZTS Visual C++ 2017 x64 ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Xdebug v2.9.3, Copyright © 2002-2020, by Derick Rethans

LARAVEL VERSION:

v7.12.0@c2fff1e9879494a6f853593b3c517dc9922bbb51

BACKPACK VERSION:

4.1.6@cbd4143d3eb8302916012af205565cd3183f274f

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, May 22, 2020

Hello guys.

Indeed this is something we have discussed and probably we will attempt to provide a solution for this.

I have corretly labeled it, and will have a discussion with @tabacitu about this.

Repeatable https://backpackforlaravel.com/docs/4.1/crud-fields#repeatable might work in this scenario, because you can intercept the request in controller and do whatever you want with it.

Maybe what is missing here is to set the max items a repeatable field can have, so you can set it to only one, am i right ? @Dzale ?

1reaction
Dzalecommented, May 21, 2020

Backpack is adding features all the time, i think they will handle this fast. 😉

If you are in big hurry you can checkout https://voyager.devdojo.com , not sure if they have the same problem…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pivot Table (Data Management)—ArcGIS Pro | Documentation
ArcGIS geoprocessing tool that creates a table from the input table by reducing redundancy in records and flattening one-to-many relationships.
Read more >
101 Advanced Pivot Table Tips And Tricks You Need To Know
Pivot tables are awesome! They're one of Excel's most powerful features, they allow you to quickly summarize large amounts of data in a...
Read more >
Use the Field List to arrange fields in a PivotTable
Rearrange fields in your PivotTable (pivot table) by using the Field List, and show the Field List again when it disappears.
Read more >
What is a Pivot Table & How to Create It? Complete 2022 Guide
The settings uses the same terms as Microsoft Excel. Row Labels are Rows, Column Labels are Columns and Summation Values are Values. A...
Read more >
Excel Pivot Table Option Settings - Contextures
The Values row appears in a pivot table heading, when there are: ... If there are other fields in the Columns area, one...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found