You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing User::editUrl directly or through other methods like User::toArray before the model has been persisted results in a UrlGenerationException. This is expected as the urls required the ID.
This breaks the creation of users.
We initially discovered this issue by installing Laravel Telescope which records all events by default and tries to serialise the model in the UserCreating event.
Not sure if this is something you want to fix, I mainly want to document it for other users any my future self. 😅
Workaround when using telescope
Add the events to the ignore list in config/telescope.php
The text was updated successfully, but these errors were encountered:
duncanmcclean
changed the title
UserCreating and UserSaving (for new) events break with Telescope or when accessing user data$user->toArray() errors when accessed in UserCreating/UserSaving event listeners
Aug 7, 2024
duncanmcclean
changed the title
$user->toArray() errors when accessed in UserCreating/UserSaving event listeners$user->toArray() errors when accessed in UserCreating/UserSaving event listeners with Laravel Telescope installed
Aug 7, 2024
duncanmcclean
changed the title
$user->toArray() errors when accessed in UserCreating/UserSaving event listeners with Laravel Telescope installed
Laravel Telescope errors when creating user via the make:user command
Aug 7, 2024
Bug description
When accessing
User::editUrl
directly or through other methods likeUser::toArray
before the model has been persisted results in aUrlGenerationException
. This is expected as the urls required the ID.This breaks the creation of users.
We initially discovered this issue by installing Laravel Telescope which records all events by default and tries to serialise the model in the UserCreating event.
Not sure if this is something you want to fix, I mainly want to document it for other users any my future self. 😅
Workaround when using telescope
Add the events to the ignore list in
config/telescope.php
How to reproduce
php please make:user
Alternatively you can install Laravel Telescope and enable it
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: