Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Livewire support #2

Closed
dennisvandalen opened this issue Jul 28, 2020 · 4 comments
Closed

Livewire support #2

dennisvandalen opened this issue Jul 28, 2020 · 4 comments

Comments

@dennisvandalen
Copy link

Thanks for this library, saves me a lot of time.

I noticed when I'm using Livewire the errors don't show. It's because in Livewire the errors are not in the session, so this line always returns an empty bag.

I also noticed that the check for hasError is not that usefull because in the layouts it's always wrapped in the @error directive. Like form-errors.blade.php

Maybe just get rid of the hasError part and just use the showError, it should be compatible with Livewire that way and you don't double check for errors.

What's your opinion on this?

@pascalbaljet
Copy link
Contributor

Thanks, I'll look into it. We use$hasError in the Bootstrap templates, but perhaps we could use the @errors directive there as well.

@pascalbaljet
Copy link
Contributor

We could depend on the Illuminate\View\Middleware\ShareErrorsFromSession middleware and assume the errors are shared with the view instances. This is how Livewire updates the errors as well.

@pascalbaljet
Copy link
Contributor

I just tagged v1.2.0 with support for Livewire:
https://github.com/pascalbaljetmedia/laravel-form-components#laravel-livewire

@dennisvandalen
Copy link
Author

Wow, awesome! Thanks @pascalbaljet 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants