๐๐ฒ๐ฒ๐ฝ ๐๐ถ๐ป๐ธ๐ถ๐ป๐ด ๐๐ถ๐๐ต ๐๐ถ๐๐ฒ๐๐ถ๐ฟ๐ฒ
You click a row. You expect to see users for the item you clicked. Do not make your users pick the same item again from a menu.
Use the #[Url] attribute. This binds a public property to the query string. The URL updates when the property changes. The property fills when the page loads from a link. This makes links shareable.
URLs are user input. Users lie. Validate the URL value in the mount method. Compare it to a list of active items. If the value is wrong, use a default.
Do not put secrets in public properties. Public properties travel to the browser. Use a computed property to strip passwords. This keeps secrets on the server.
Test your links. Use Livewire::withQueryParams() to simulate a real visit.
- Use #[Url] for shareable state.
- Validate URL input in the mount method.
- Strip secrets using computed properties.
- Test hydration with withQueryParams.
Source: https://dev.to/nasrulhazim/deep-linkable-livewire-scoping-a-browser-to-the-thing-you-clicked-52co