Laravel-Backpack / CRUD

Build custom admin panels. Fast!
https://backpackforlaravel.com
MIT License
3.14k stars 892 forks source link

[Bug] #2889

Closed Davidinho241 closed 4 years ago

Davidinho241 commented 4 years ago

Bug report

What I did

Hi Team, I have use Backpack like this :

The controller

`/**

What I expected to happen

I expected to create a user

What happened

The user is create successfully but a get this :

Call to a member function update() on string

Backpack\CRUD\app\Library\CrudPanel\CrudPanel::createRelationsForItem vendor/backpack/crud/src/app/Library/CrudPanel/Traits/Create.php:183

What I've already tried to fix it

Cancel the project 2 times and restart

Backpack, Laravel, PHP, DB version

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

welcome[bot] commented 4 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication channels:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

pxpm commented 4 years ago

My guess is that you have a role as attribute and a role as relation.

You could use for attribute getRoleNameAttribute for example.

I am going to close this as I don't think this is a bug with backpack.

If I am wrong, and sometimes I am, please re-open.

Best, Pedro

Davidinho241 commented 4 years ago

My guess is that you have a role as attribute and a role as relation.

You could use for attribute getRoleNameAttribute for example.

I am going to close this as I don't think this is a bug with backpack.

If I am wrong, and sometimes I am, please re-open.

Best, Pedro

I have remove the function getRoleAttribute and getGenderAttribute but the issue remain.

I have also try to use the getRoleNameAttribute but nothing.

I have clear the cache but nothing

I think the issue is because, the store function try to insert the value of the role

$item->{$relationMethod}->update($relationData['values']);

Please help

support[bot] commented 4 years ago

Oups!

Looks like this is a support request, not a bug/feature. Could you please repost on StackOverflow, using the backpack-for-laravel tag?

Background: Here at Backpack we use Github Issues only for tracking bugs and features, not individual implementation issues. This helps a lot in keeping our focus on improving Backpack. Thanks a lot for understanding!

Here are all the Backpack communication mediums:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or StackOverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

PS. In case I mistakenly closed your issue, yell :-) I'm a robot, I make mistakes.