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

CRUD opration bug in laravel metronic theme


When i click on add user button at that time it will open an empty form but when i click on edit user and after that without close i discard form and then after i open add user form it will open a form with last opened data and when i create it will update that last opened user not create new user.

Please check video for the reference:
Link


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 (1)


Hi Nipesh,

Sorry for the delay. We appreciate your patience. We have identified the issue and will be fixing it in the upcoming release.

As a temporary workaround, you can add the following code:

1. Open the file `/resources/views/pages/metronic/apps/user-management/users/list.blade.php`


<script>
//...
$("#kt_modal_add_user").on("hidden.bs.modal", function () {
Livewire.dispatch("new_user");
});
</script>


2. Open the file /app/Livewire/User/AddUserModal.php



protected $listeners = [
//...
"new_user" => "hydrate",
];



public function hydrate()
{
//...
// add reset function
$this->reset();
}


This code ensures that when the 'Add User' modal is closed, it will dispatch an event to reset the form fields, preventing the issue of creating a new user with the last opened user's data.

Thank you for bringing this to our attention, and we apologize for any inconvenience caused. If you have any further questions or concerns, feel free to reach out.


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  :(