php - VueJS variable inside URL::action in Laravel -


i new vuejs.

i have link using laravel helpers:

<a href="{!!   url::action('tournamentcontroller@edit',  $tournament->id) !!}">{{ $tournament->id }}</a> 

as inside vuejs v-for, need refer vue variables load ajax.

so, tried write that:

<a href="{!!   url::action('tournamentcontroller@edit',  @{{ tournament.id }} ) !!}">@{{ tournament.id }}</a> 

but

parse error: syntax error, unexpected '{' (view: /home/vagrant/code/resources/views/tournaments/index.blade.php) 

any idea how mix laravel helper , vuejs?

first of looks you're missing quotes around @{{ tournament.id }}.

but after playing around myself doesn't seem possible @ moment due routes using same brackets placeholders.

a workaround create simple function somewhere generates url unique placeholder , afterwards str_replace call on generated url.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -