0
votes

I have a shop model you can see it

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use TCG\Voyager\Traits\Spatial;


class Shop extends Model
{
    use Spatial;

​   protected $spatial = ['lat'];
}

but it consistently giving me error after writing these lines of code

syntax error, unexpected '​' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

1
can u share your code that is inside the trait ?Abdes
no i cannot. its a module which i am using as you can see.Hassan ALi
Which line is the error on? Which version of Voyager are you using?Thomas
on line 13 and voyager version is 13.1Hassan ALi

1 Answers

0
votes

You have a ZERO WIDTH SPACE (U+200B) character at the start of the protected $spatial = ['lat']; line. You can copy the code (from the question) and run it through a tool that revelas non-printable characters (for example https://www.soscisurvey.de/tools/view-chars.php) to see it.

To prevent bugs like this in the future, you may want to configure your editor to display non-printable characters, however not all editors have this feature.