Laravel Weekly Update #10: Precognition

  Рет қаралды 9,254

Laravel

Laravel

Күн бұрын

Пікірлер: 20
@aghitsnidallah7953
@aghitsnidallah7953 Жыл бұрын
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
@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
@aghitsnidallah7953 Жыл бұрын
@@timacdonald Hi, thanks a lot for the reply. It's a relief to know.
@epicgameryt4052
@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
@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
@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
@vinit095 Жыл бұрын
Do we really need it for the API? Because they will get the response of validation on submission
@timacdonald
@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
@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
@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
@maximmaxim1074 Жыл бұрын
But I can also make an event listener on focus out sending a post request to check if email is available?
@vinit095
@vinit095 Жыл бұрын
This feature is quite good
@danmatthews3431
@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
@timacdonald Жыл бұрын
The repository is public. laravel/precognition
@bulent2435
@bulent2435 Жыл бұрын
That looks awesome.
@bimasakti-nb2el
@bimasakti-nb2el Жыл бұрын
Are this support inertia v1.0?
@SmailPeche
@SmailPeche Жыл бұрын
nice feature, what about blade if i don't work with vue js ? any help please ?!
@timacdonald
@timacdonald Жыл бұрын
There is an Alpine version available, otherwise it is possible to use with vanilla JS, but we don't have an approach documented.
@日本人-i4e
@日本人-i4e 8 ай бұрын
很好很喜欢
@haroldpepete
@haroldpepete Жыл бұрын
silcereeeeee
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
Laravel Gems - Pipelines 💎
15:21
Laravel
Рет қаралды 10 М.
Let's talk about Events and Listeners
8:23
Laravel
Рет қаралды 7 М.
Laravel DB Optimization: From 1.5k to 26 Queries
14:49
Laravel Daily
Рет қаралды 20 М.
The New Features of Inertia 2.0 in 3 Minutes
3:01
Laravel
Рет қаралды 11 М.
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 87 М.
Without Defer & Unique String IDs in Laravel 11.30
6:22
Laravel
Рет қаралды 4,8 М.
PHP Enum for Laravel User Roles: Why and How?
5:32
Laravel Daily
Рет қаралды 11 М.