All Projects β†’ ichtrojan β†’ Laravel Location

ichtrojan / Laravel Location

Licence: mit
A simple Laravel Package to sort Countries, States and Cities

Projects that are alternatives of or similar to Laravel Location

Flex Env
🌳 Manage your .env file in Laravel projects through artisan
Stars: ✭ 95 (-41.36%)
Mutual labels:  laravel, package
Laravel Optimus
Transform your internal id's to obfuscated integers based on Knuth's integer hash. Laravel wrapper for the Optimus Library by Jens Segers with multiple connections support.
Stars: ✭ 119 (-26.54%)
Mutual labels:  laravel, package
Laravel Google Translate
This package makes using the Google Translate API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.
Stars: ✭ 97 (-40.12%)
Mutual labels:  laravel, package
Laravel Totem
Manage Your Laravel Schedule From A Web Dashboard
Stars: ✭ 1,299 (+701.85%)
Mutual labels:  laravel, package
Laravel Governor
Manage authorization with granular role-based permissions in your Laravel Apps.
Stars: ✭ 131 (-19.14%)
Mutual labels:  laravel, package
Laravel Analytics
Analytics for the Laravel framework.
Stars: ✭ 91 (-43.83%)
Mutual labels:  laravel, package
Laravel Natural Language
This package makes using the Google Natural API in your laravel app a breeze with minimum to no configuration, clean syntax and a consistent package API.
Stars: ✭ 119 (-26.54%)
Mutual labels:  laravel, package
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (-51.23%)
Mutual labels:  laravel, package
Laravel Short Url
A Laravel package to shorten urls
Stars: ✭ 127 (-21.6%)
Mutual labels:  laravel, package
Roadrunner Laravel
[ABANDONED] Moved to https://github.com/spiral/roadrunner-laravel
Stars: ✭ 124 (-23.46%)
Mutual labels:  laravel, package
Laravel Package Maker
Get a πŸ“¦ skeleton and all other `make` commands from laravel base for package development.
Stars: ✭ 89 (-45.06%)
Mutual labels:  laravel, package
Youtube
Upload a video to a single YouTube channel with Laravel 5.
Stars: ✭ 143 (-11.73%)
Mutual labels:  laravel, package
Laravel Nullable Fields
Handles saving empty fields as null for Eloquent models
Stars: ✭ 88 (-45.68%)
Mutual labels:  laravel, package
Laravel Likeable
Rate Eloquent models with Likes and Dislikes in Laravel. Development moved to Laravel Love package!
Stars: ✭ 95 (-41.36%)
Mutual labels:  laravel, package
Laravel Mixpanel
Intuitive drop-in analytics.
Stars: ✭ 80 (-50.62%)
Mutual labels:  laravel, package
Laravel Factory Prefill
Prefills factories with faker method suggestions to increase productivity
Stars: ✭ 104 (-35.8%)
Mutual labels:  laravel, package
Manager
Implementation of the Manager pattern existing in Laravel framework
Stars: ✭ 74 (-54.32%)
Mutual labels:  laravel, package
Laravel Country State
A helper to list countries & states in English in Laravel 5.1+
Stars: ✭ 77 (-52.47%)
Mutual labels:  laravel, country
Guardian
Eloquent Guardian is a simple permissions system for your users. While there are many other packages for permissions, this one solves everything in the most eloquent way.
Stars: ✭ 121 (-25.31%)
Mutual labels:  laravel, package
Laravel Paket
Composer GUI. Manage Laravel dependencies from web interface without switching to command line!
Stars: ✭ 143 (-11.73%)
Mutual labels:  laravel, package

Laravel Location β–²

hero

Introduction πŸ––

This Package offers a simple way to get Countries, Cities and States that you may need for your Application, most especially for dropdown menus.

Step One - Install via Composer 🎼

Require the package via composer into your project

composer require ichtrojan/laravel-location

composer install

Step Two - Publish Configurations βš™οΈ

Laravel location provides you with an easy way of customizing the tables used for storing Countries, States and Cities. Also, you can customisethe route prefix and middleware. To customize these you need to publish the configuration file. To publish the configuration file, run:

php artisan vendor:publish --tag=laravel-location

You will have config/location.php available for you to edit. The default configurations are:

<?php

return [
    'countries_table' => 'countries',
    'cities_table' => 'cities',
    'states_table' => 'states',
    'routes' => [
        'prefix' => 'location',
        'middleware' => 'web'
    ]
];

You can go ahead and customize the table names, route prefix and middleware as you need before running the Migration.

Step Three - Running Migrations

before you do this make sure your correct Database credentials are set in the .env file

php artisan migrate

migrations

Finally, run the Package seeders

php artisan db:seed --class=Ichtrojan\\Location\\Seeds\\LocationDatabaseSeeder

Usage 🧨

NOTE
The routes below are prefixed with location which is the default configuration set in the config/location.php file. If mofified, replace the prefixin your route with the correct prefix.

Route Description
/location/countries return all countries
/location/country/{id} return a single country by its ID
/location/states return all states
/location/state/{id} return a single state by its ID
/location/states/{countryID} return all states in a country using the country ID
/location/cities return all cities
/location/city/{id} return a single city by its ID
/location/cities/{stateID} return all cities in a state using the state ID

Test

composer test

Contribution

Free for all, if you find an issue with the package or if a group of people somehow created a new country please send in a PR.

Danke SchΓΆn

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].