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.

BackPack field type checklist data is not loading pivot table on creation and updation

See original GitHub issue

Hey team I want to assign permissions to users while creating or updating. So used checklist type data with the backpack permission manager. Follow is my code which I put for column type checklist.

CRUD::addColumn(
            [
                'label'     => 'Permissions',
                'type'      => 'checklist',
                'name'      => 'permissions',
                'entity'    => 'permissions',
                'attribute' => 'name',
                'model'     =>"Backpack\PermissionManager\app\Models\Permission",
                'pivot'     => true,
            ],
        );

This was working fine until I upgraded laravel backpack to v5 with backpack/pro.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tabacitucommented, May 2, 2022

Thanks @zain534102 so do I understand correctly that this is a UI problem? That:

  • the entries are saved correctly in the db (in the pivot table)
  • but after the page reload, the correct checkboxes are not checked?

If so, can you please

  • go to the vendor/backpack/crud/src/resources/views/crud/fields/checklist.blade.php file
  • do a @dump($field) as the very first line
  • do a @dump($field) after the @endphp line
  • copy-paste the output for both here

Thanks!

0reactions
tabacitucommented, Jul 11, 2022

@zain534102 I assume you’ve gotten to the bottom of this, and it was a problem specific to your project? If not, let us know and we’ll reopen. If so, and you remember what it was, it’s always best to reply here with the cause/solution. That way if you have the same problem some other time, you’ll find it. Not to mention it could help others with the same problem.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backpack Field Type Checklist is not Showing Pivot table data ...
I want to assign permissions to users while creating or updating. So used checklist type data with the backpack permission manager.
Read more >
Fields :: 5.x Docs - Backpack for Laravel
Field types define how the admin can manipulate an entry's values. They're used by the Create and Update operations. Think of the field...
Read more >
How to Troubleshoot and Fix Excel Pivot Table Errors
How to troubleshoot and fix Excel pivot table errors, such as PivotTable field name is not valid. Find the problem, and fix it....
Read more >
BackpackForLaravel/Lobby - Gitter
Hello guys, In my create form page, I have a checkbox field and if user checked then i want to show user to...
Read more >
Intro to pivot tables in Numbers on Mac - Apple Support (HK)
You can create pivot tables to analyse data, quickly group and calculate values, and identify interesting patterns and trends. A pivot table showing...
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