I'm trying to use my javascript variable with laravel.But I'm getting this error.
error:
Use of undefined constant tag - assumed 'tag'
Use of undefined constant tag - assumed 'tag'
and this is my code.
var tag = location.tagCode;
var rfidString = ('{!!\App\Rfid::where('rfid_id', tag)->first()!!}')
var rfid = JSON.parse(rfidString);