Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Google Map Laravel Package

arcasolutions/google-map

Laravel package providing Google Maps integration for your app, with helpers to generate map views and include the required scripts. Useful for quickly embedding maps and configuring markers or map options within Laravel projects.

View on GitHub
Deep Wiki
Context7

Autocomplete

The Places Autocomplete feature attaches to a text field on your web page, and monitors that field for character entries. As text is entered, Autocomplete returns Place predictions to the application in the form of a drop-down pick list. You can use the Places Autocomplete feature to help users find a specific location, or assist them with filling out address fields in online forms.

Build your autocomplete

In order to use the Google Autocomplete feature, you need to build & configure it.

use Ivory\GoogleMap\Places\Autocomplete;
use Ivory\GoogleMap\Places\AutocompleteComponentRestriction;
use Ivory\GoogleMap\Places\AutocompleteType;

$autocomplete = new Autocomplete();

$autocomplete->setPrefixJavascriptVariable('place_autocomplete_');
$autocomplete->setInputId('place_input');

$autocomplete->setInputAttributes(array('class' => 'my-class'));
$autocomplete->setInputAttribute('class', 'my-class');

$autocomplete->setValue('foo');

$autocomplete->setTypes(array(AutocompleteType::ESTABLISHMENT));
$autocomplete->setComponentRestrictions(array(AutocompleteComponentRestriction::COUNTRY => 'fr'));
$autocomplete->setBound(-2.1, -3.9, 2.6, 1.4, true, true);

$autocomplete->setAsync(false);
$autocomplete->setLanguage('en');

Render your autocomplete

Now, you have builded & configured your autocomplete, you can render it. For this purpose, you will need the Ivory\GoogleMap\Helper\Places\AutocompleteHelper which allows to render the autocomplete html container & some javascript for being able to render it.

use Ivory\GoogleMap\Helper\Places\AutocompleteHelper;

$autocompleteHelper = new AutocompleteHelper();

Render the HTML container

echo $autocompleteHelper->renderHtmlContainer($autocomplete);

This function renders an html input with the ID, the value & the html attributes:

<input id="place_autocomplete" type="text" placeholder="off" value="foo" />

Render the javascript

echo $autocompleteHelper->renderJavascripts($autocomplete);

This function renders an html javascript block with all code needed for displaying your autocomplete.

<script type="text/javascript">
    // Code needed for displaying your autocomplete
</script>
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky