Search by

dravencms / location

Salamek

DravenCMS Location module

Package info

github.com/dravencms/location

Type:dravencms-package

pkg:composer/dravencms/location

Statistics

Installs: 570

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.8.2 2026-11-03 21:06 UTC

This package is auto-updated.

Last update: 2026-11-03 21:07:00 UTC


README

Reusable geographical data model and administration for DravenCMS. It manages countries, regions, cities, streets, street numbers, and postal codes for packages that need structured addresses.

Features

  • Country data based on umpirsky/country-list.
  • Region, city, street, street-number, and ZIP-code entities.
  • Repositories and pair/query helpers for application forms.
  • Optional administration grids and forms.
  • Provider-defined ACL permissions and admin navigation.

Installation

composer require dravencms/location

The package loader registers its services and Doctrine attribute mappings. Apply the package schema through the application's migration workflow and run php bin/console location:setup to install country data before creating dependent records.

Install dravencms/admin to expose management presenters and dravencms/user for provider-defined permissions.

Usage

Inject the repository matching the required level, such as CountryRepository, CityRepository, or StreetRepository. Store entity relationships rather than duplicated display strings when the address must remain queryable.

The package models location levels independently because real addresses do not always have every level. Application validation should require only the parts needed by that domain.

License

This package is licensed under the LGPL-3.0 license.

Installing default data

Run php bin/console location:setup after creating or migrating the application schema. The command adds missing defaults in a transaction and can be rerun on an active project. It never purges data or updates existing records, including customized names, formats, templates, active flags and default selections. Run setup commands one at a time. Schema creation/migration remains separate. Fixtures are no longer registered.

Adds all countries from the installed English country dataset, matching by country code. Add --example-address to explicitly install the former Olomouc / 77900 / Brněnská / 54 example; address rows are matched within their parent country, city, ZIP code or street.

Admin authorization and mutations

Administration uses User 3.1, Admin 3.2 and Application 0.3 guards. Screens and write callbacks enforce the existing provider-defined permissions server-side, including direct URLs and bulk callbacks. Mutating signals require POST and a session-bound action token; synchronize the matching admin assets when upgrading. See the User package's user:security:migrate instructions for the password-reset schema change.