This is an outline for two Livewire features:
mount() method:Route::get('/post/{post}, ShowPost::class)
class ShowPost extends Component
{
public Post $post;
// Notice no mount method needed.
}
md5-c1e67e92f927508a51f8aaf14fb52906
```php
class ShowPost extends Component
{
public Post $post;
public function changePost(Post $newPost)
{
$this->post = $newPost;
}
}
A user visits /post/1, and then clicks a Livewire button that calls "changePost(2)", the URL now says /post/2 without ever changing pages. (using pushState).
This should work with ANY route parameters no matter if they are route model bound or not.
We just had a long call with @calebporzio, @inxilpro and myself about these features and we're going to be implementing them on our end.
Just tested it AWESOME!!!
Most helpful comment
Just tested it AWESOME!!!