bpocallaghan/locations

Add countries, provinces, cities and suburbs to your laravel admin project - https://github.com/bpocallaghan/laravel-admin-starter

Installs: 4 245

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 3

Forks: 1

Open Issues: 0

Language:HTML

0.0.1 2017-11-02 09:11 UTC

This package is auto-updated.

Last update: 2024-04-23 17:37:01 UTC


README

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)