Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

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
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


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);



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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(