Skip to content

Fix/store record id for edit#18

Merged
saade merged 7 commits into
saade:mainfrom
wychoong:fix/store-record-id-for-edit
Jul 3, 2022
Merged

Fix/store record id for edit#18
saade merged 7 commits into
saade:mainfrom
wychoong:fix/store-record-id-for-edit

Conversation

@wychoong

Copy link
Copy Markdown
Contributor

currently there is no way to retrieve the id or record, with this PR, you can do this

    public function resolveEventRecord(array $data): Model
    {
        return Appointment::find($data['id']);  // or slug return Appointment::where('slug', $data['extendedProps']['slug']); <- the $data structure not tested
    }

    public function editEvent(array $data): void
    {
        $this->record->update($data);
        $this->refreshEvents();
    }

@saade

saade commented Jun 30, 2022

Copy link
Copy Markdown
Owner

I dont plan to include any database related stuff into this lib. The ID should be received in $data.

@wychoong

wychoong commented Jul 1, 2022

Copy link
Copy Markdown
Contributor Author

I dont plan to include any database related stuff into this lib. The ID should be received in $data.

It won’t be in $data if there is no id field in the form. Don’t think that’s the right way of passing id thou, it will be modifiable by user.

@saade

saade commented Jul 1, 2022

Copy link
Copy Markdown
Owner

you are correct. ill take a look at this tomorrow

@ashleyhood

Copy link
Copy Markdown
Contributor

For what it is worth, I think this would be helpful. I solve this at the moment by having to store the id on the widget when onEventClick or onEventDrop method is called and then having to retrieve the id in the editEvent method.

@saade

saade commented Jul 2, 2022

Copy link
Copy Markdown
Owner

@wychoong do you mind writing the docs for this?

also, please resolve the conflicts and we are good to merge this =)

@wychoong

wychoong commented Jul 3, 2022

Copy link
Copy Markdown
Contributor Author

@wychoong do you mind writing the docs for this?

also, please resolve the conflicts and we are good to merge this =)

sorry for the late, was taking few days off due to covid

@saade saade merged commit 7bc7acc into saade:main Jul 3, 2022
@dbrnjh47

dbrnjh47 commented Jul 2, 2024

Copy link
Copy Markdown

Similar problem, I asked this question and also there is an outcome to solve the problem

filamentphp/filament#13198

@wychoong wychoong deleted the fix/store-record-id-for-edit branch July 2, 2024 16:12
@wychoong

wychoong commented Jul 2, 2024

Copy link
Copy Markdown
Contributor Author

Similar problem, I asked this question and also there is an outcome to solve the problem

filamentphp/filament#13198

I don’t see how is that relevant. Please use the right channel for your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants