namespace App;
use Illuminate\Database\Eloquent\Model;
class Marker extends Model
{
protected $fillable = [
'id', 'name', 'address', 'lat', 'lng', 'type',
];
}
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class Marker extends JsonResource
{
public function toArray($request)
{
return parent::toArray($request);
return [
'id' => $this->id,
'name' => $this->name,
'address' => $this-> address,
'lat' => $this-> lat,
'lng' => $this-> lng,
'type' => $this-> type,
];
}
}
получаю на странице:
red square
dzerzhinscogo, 100
45.102001
38.984066
red square
dzerzhinscogo, 101
45.10194
38.971405
red square
dzerzhinscogo, 102
45.105152
38.989773
Как теперь это перенести в виде маркеров на карту?