protonemedia / laravel-splade

💫 The magic of Inertia.js with the simplicity of Blade 💫 - Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, and sparkle it to make it interactive. All without ever leaving Blade.
https://splade.dev
MIT License
1.47k stars 111 forks source link

Question: How to use route method in remote-url option of x-splade-select #554

Closed p4rad0xus closed 7 months ago

p4rad0xus commented 7 months ago

Description:

In a Spalde Form I use the x-splade-select component with the remote-url option. The url expect a id which comes from another form component. Currently I have to specify the URL directly:

<x-splade-select name="region" remote-url="`/api/regions/${form.country}`" />

Is there a way to use the route method from Laravel to pass the url? Maybe in this way:

<x-splade-select name="region" remote-url="{{ route('regions.country', ['country' => $form->country ]) }}" />
dusp2k commented 7 months ago

I don't think that's possible. route() is server-side and ${form.country} is client-side/vue.