Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Error in create and update user


I try to edit user and after i update, error avatar.

same after i try to create user have error assign role


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

I apologize for the inconvenience. It seems there is a bug. As a workaround, you can follow these steps:

Locate the file: /laravel/starterkit/app/Livewire/User/AddUserModal.php somewhere at line 80.

Update the code block as follows:

$data["email"] = $this->email;
$user = User::find($this->user_id) ?? User::create($data);


Thanks



Hi,

Could you please provide a screenshot of the error you're encountering or any specific error messages?

Additionally, it would be helpful to check the console log for any JavaScript errors that might be related to the avatar update issue. Please inspect the browser console for any error messages or warnings.

Also, ensure that you have run the following command to create a symbolic link:

php artisan storage:link


This command is crucial for serving files stored in the "storage/app/public" directory through the "public/storage" path.



yes after i write php artisan storage:link, link already exists.

and i try again to update user, avatar same not show.

and after i try add user i have error :
Call to a member function assignRole() on null .
=> $user->assignRole($this->role);


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(