Add countries, provinces, cities and suburbs to your laravel admin project - https://github.com/bpocallaghan/laravel-admin-starter
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
database
resources/views/admin
LICENSE
composer.json Initial commit Nov 2, 2017
readme.md

readme.md

Locations

Add countries, provinces, cities and suburbs to your laravel admin project. This will allow you to add cities, countries, each with a google map location.

Installation

Update your project's composer.json file.

composer require bpocallaghan/locations

Usage

Register the routes in the routes/vendor.php file.

  • Admin
Route::group(['prefix' => 'general/locations', 'namespace' => 'Locations\Controllers\Admin'], function () {
    Route::resource('suburbs', 'SuburbsController');
    Route::resource('cities', 'CitiesController');
    Route::resource('provinces', 'ProvincesController');
    Route::resource('countries', 'CountriesController');
});

Commands

php artisan locations:publish

This will copy the database/seeds and database/migrations to your application. Remember to add $this->call(LocationTableSeeder::class); in the DatabaseSeeder.php

php artisan locations:publish --files=all

This will copy the models, views and controllers to their respective directories. Please note when you execute the above command. You need to update your routes.

  • Admin
Route::group(['prefix' => 'locations', 'namespace' => 'Locations'], function () {
    Route::resource('suburbs', 'SuburbsController');
    Route::resource('cities', 'CitiesController');
    Route::resource('provinces', 'ProvincesController');
    Route::resource('countries', 'CountriesController');
});

Demo

Package is being used at Laravel Admin Starter project.

TODO

  • add the navigation seeder information (to create the navigation/urls)