How is this Precognition works in the background? Implying the requests is sent every time the input blurs, will it impact the low-end server performance?
@timacdonald Жыл бұрын
Tim here, creator of this feature for the team. That really depends on your server and application context (user load, etc.). You don't have to use Precognition on all forms and for forms where you do use it, you may also "sprinkle" Precognition onto forms where it makes sense. You could use Precognition to validate only the email address and it won't send a request when the "name" field is blurred, for example.
@aghitsnidallah7953 Жыл бұрын
@@timacdonald Hi, thanks a lot for the reply. It's a relief to know.
@epicgameryt4052 Жыл бұрын
Absolute goats who made this! We had some troubles when working with our headup setup between the frontend and senior engineers, both had to duplicate rules which caused some issues.
@adityakadam2256 Жыл бұрын
That's a great feature. A quick question, seems like this is only applicable for web routes, will it be or could it be applied for API routes?
@timacdonald Жыл бұрын
Tim here, creator of this feature for the team. You could absolutely add this to an API route! This was something I played around with during development of the feature.
@vinit095 Жыл бұрын
Do we really need it for the API? Because they will get the response of validation on submission
@timacdonald Жыл бұрын
@@vinit095 You don't _need_ it in either case, however using it on your API would allow 3rd party applications to also provide live validation - if that is something you wanted.
@MatteoPresot Жыл бұрын
What about fortify or breeze? Are they already compatible? Is there any drawback on putting a single Precognition Middleware in front of all routes?
@fenilli Жыл бұрын
Quick question if both name and email where added to precognition, will it sent two requests when those values change? will it cancel previous ones and add all in one request? and if so, if I keep changing the first field before the timeout runs, will the second field be also waiting for the response to show validation for both at the same time?
@maximmaxim1074 Жыл бұрын
But I can also make an event listener on focus out sending a post request to check if email is available?
@vinit095 Жыл бұрын
This feature is quite good
@danmatthews3431 Жыл бұрын
It's a perfect fit for some forms we're moving from Livewire to Inertia + Svelte, will the source code be available at some point so we can look at building an Adapter for it that we could share with the community?
@timacdonald Жыл бұрын
The repository is public. laravel/precognition
@bulent2435 Жыл бұрын
That looks awesome.
@bimasakti-nb2el Жыл бұрын
Are this support inertia v1.0?
@SmailPeche Жыл бұрын
nice feature, what about blade if i don't work with vue js ? any help please ?!
@timacdonald Жыл бұрын
There is an Alpine version available, otherwise it is possible to use with vanilla JS, but we don't have an approach documented.