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

Egulias Provinces Bundle Laravel Package

egulias/egulias-provinces-bundle

View on GitHub
Deep Wiki
Context7

Provinces bundle for Symfony2/Doctrine2

This bundle is intended to allow you to easily have the basic structure of regions-provinces of a given country (or all, I hope).

Build
Status

Installation and configuration:

Get the bundle

Add to your /deps file :

[EguliasProvincesBundle]
    git=http://github.com/egulias/EguliasProvincesBundle.git
    target=/bundles/Egulias/ProvincesBundle
  • Side note: if you want provinces and regions in the database, you will need doctrine-fixtures and DoctrineFixturesBundle

    [doctrine-fixtures]   
        git=http://github.com/doctrine/data-fixtures.git
    
    [DoctrineFixturesBundle]
        git=http://github.com/symfony/DoctrineFixturesBundle.git
        target=/bundles/Symfony/Bundle/DoctrineFixturesBundle 
    

And make a php bin/vendors install.

Register the namespace

<?php

  // app/autoload.php
  $loader->registerNamespaces(array(
      'Egulias' => __DIR__.'/../vendor/bundles',
      // your other namespaces
      ));
  • Installation note for Database fixtures: Also add this to registerNamespaces

        'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib', 
    

Add EguliasProvincesBundle to your application kernel

<?php

  // app/AppKernel.php
  public function registerBundles()
  {
    return array(
      // ...
      new Egulias\EguliasProvincesBundle\EguliasProvincesBundle(),
      // ...
      );
  }
  • Installation note for Database fixtures: Also add
    new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),

Usage

  • Without a database Just use the needed localized Entity for regions or provinces (as of this writing, only SpainProvince) and use the provided methods.

  • With Database Features have been removed, but will be available soon

    • First you'll need to do a app/console doctrine:schema:update --force (or --dump-sql first to see the sql to be executed) to generate the db tables.
    • Secondly you'll need to dump data with app/console doctrine:fixtures:load --fixtures=vendor/bundles/Egulias/EguliasProvincesBundle/DataFixtures/ORM/ If you want just to dump specific countries data, just point to the corresponding data fixture (e.g LoadSpanishRegions)
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