Laravel passing variables inside route accessing a named route

I am trying to pass 3 variables values inside an html link that uses route to access a named routed with this code:

<a href="{{ route('gegonota', ['gid' => $gid,'cid' => $cid , 'nid' => $nid]) }}">{{$nomos->name}}</a>

also the route function is

Route::get('gegonota/{gid?}/{cid?}/{nid?}', ['uses' => 'GegonosController@index', 'as' => 'gegonota']);

but it doesnt work right.
How can i do it.
thanks


Source: stackoverflow-php

how to hold javascript variable in php variable

I want to use javascript variable as php variable. I am echo php variable then its print. but when i am use for fetching data from database its show an error
Notice: Undefined index: document.write(i)

here my code

javascript

var i=0;
function inc()
{
    i+=1;
}
<?php $foo="document.write(i)"; ?>

php

code work for

echo $foo

code not work for

$i=$foo;
$query="select * from TABLE where id = $i";
$result=mysqli_query($conn,$query);
while($row=mysqli_fetch_row($result))
    {
        echo $row[0];
    }

Then It show This Error Notice: Undefined index: document.write(i)


Source: stackoverflow-php

How do I call for a certain variable or another depending on a string I have

I have two variables, varL and varR, which have the information that they are L and R respectively. Depending on wether a third object has as imput ‘L’ or ‘R’, I would like to reference varL or varR respectively. Is there any way to do this?

Specifically, varL and varR are arrays. If the third object has as imput ‘L’, I would like to have access to varL[i] for some i, and the same goes for ‘R’. I know this is not even remotely correct, but I was looking for something like

(var +’L’)[i] or something


Source: stackoverflow-javascript