Skip to content

Commit 3e20677

Browse files
committed
Update readme file
1 parent 5255103 commit 3e20677

File tree

1 file changed

+174
-12
lines changed

1 file changed

+174
-12
lines changed

README.md

Lines changed: 174 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,233 @@
1-
<p align="center">
2-
<img src="https://github.com/lwwcas/laravel-countries/blob/master/assets/map.jpg" />
1+
<p align="center">
2+
<img src="https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/map.jpg" />
33
</p>
44

5-
# Very short description of the package
6-
75
[![Latest Version on Packagist](https://img.shields.io/packagist/v/lwwcas/laravel-countries.svg?style=flat-square)](https://packagist.org/packages/lwwcas/laravel-countries)
8-
[![Build Status](https://img.shields.io/travis/lwwcas/laravel-countries/master.svg?style=flat-square)](https://travis-ci.org/lwwcas/laravel-countries)
9-
[![Quality Score](https://img.shields.io/scrutinizer/g/lwwcas/laravel-countries.svg?style=flat-square)](https://scrutinizer-ci.com/g/lwwcas/laravel-countries)
6+
107
[![Total Downloads](https://img.shields.io/packagist/dt/lwwcas/laravel-countries.svg?style=flat-square)](https://packagist.org/packages/lwwcas/laravel-countries)
118

9+
# Very short description of the package
10+
11+
Laravel-Countries, is a package that contains everything you need to start a new project and have all countries, information and translations on hand.
12+
**And all this optimized for Laravel 8.**
13+
14+
The package provides all data directly to your database, allowing you to link to any other table in your database, in a simple and usual way.
15+
16+
<p align="center">
17+
<img src="https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/EER-countries.png" />
18+
</p>
19+
20+
### Geology and topology maps
21+
22+
Amongst many other information you'll be able to plot country maps:
23+
24+
<p align="center">
25+
<img src="https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/brazil-map.png" />
26+
</p>
27+
28+
### Available Languages?
29+
| Language |
30+
------------------|
31+
| English |
32+
| Portuguese |
33+
| Spanish |
34+
| Italian |
35+
36+
37+
1238
## Requirements
13-
- [PHP](https://github.com/php) >=^7.3|^8.0
14-
- [laravel/framework](https://github.com/laravel/framework) >=^8.12
15-
- [dimsav/laravel-translatable](https://github.com/Astrotomic/laravel-translatable) >=^11.8
39+
40+
- [PHP](https://github.com/php) >= ^7.3 | ^8.0
41+
42+
- [laravel/framework](https://github.com/laravel/framework) >= ^8.12
43+
44+
- [dimsav/laravel-translatable](https://github.com/Astrotomic/laravel-translatable) >= ^11.8
45+
46+
1647

1748
## Installation
1849

50+
51+
1952
You can install the package via composer:
2053

54+
55+
2156
```bash
57+
2258
composer require lwwcas/laravel-countries
59+
2360
composer dump-autoload
61+
2462
```
2563

64+
65+
2666
- Put this line into database\seeds\DatabaseSeeder.php in run function
67+
2768
```php
69+
2870
$this->call(\Lwwcas\LaravelCountries\Database\Seeders\LcDatabaseSeeder::class);
71+
2972
```
3073

74+
75+
3176
- Run migrations
77+
3278
```bash
79+
3380
php artisan migrate
81+
3482
```
83+
3584
- Run seeds or only the LcDatabaseSeeder class
85+
3686
```bash
87+
3788
php artisan db:seed
89+
3890
```
3991

92+
4093
## Usage
94+
You can access all the information in the database with a simple query
95+
96+
``` php
97+
use Lwwcas\LaravelCountries\Models\Country;
98+
99+
Country::whereIso('BR')->first();
100+
Country::whereIsoAlpha3('BRA')->first();
101+
Country::whereSlug('brasil')->first();
102+
```
103+
104+
<p align="center">
105+
<img src="https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/country-model.png" />
106+
</p>
41107

42-
``` php
43-
// Usage description here
108+
## Take a good look at the Model and see the package makes it easy
109+
110+
[Country](https://github.com/lwwcas/laravel-countries/blob/master/src/models/Country.php)
111+
[CountryTranslation](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryTranslation.php)
112+
[CountryRegion](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryRegion.php)
113+
[CountryRegionTranslation](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryRegionTranslation.php)
114+
[CountryGeographical](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryGeographical.php)
115+
116+
117+
### Example data
118+
119+
``` json
120+
121+
{
122+
"id": 30,
123+
"lc_region_id": 2,
124+
"uuid": "343d2082-f6fb-42e6-ac7a-f78dad39de31",
125+
"slug": "brazil",
126+
"name": "Brazil",
127+
"official_name": "Federative Republic of Brazil",
128+
"iso_alpha_2": "BR",
129+
"iso_alpha_3": "BRA",
130+
"iso_numeric": 76,
131+
"geoname_id": "3469034",
132+
"international_phone": "55",
133+
"languages": "[pt]",
134+
"tld": "[.br]",
135+
"wmo": "BZ",
136+
"emoji": {
137+
"img": "🇧🇷",
138+
"uCode": "U+1F1E7 U+1F1F7"
139+
},
140+
"color_hex": [
141+
"#008000",
142+
"#ffff00"
143+
],
144+
"color_rgb": [
145+
"0,128,0",
146+
"255,255,0"
147+
],
148+
"coordinates": {
149+
"latitude": {
150+
"classic": "10 00 S",
151+
"desc": "-10.81045150756836"
152+
},
153+
"longitude": {
154+
"classic": "55 00 W",
155+
"desc": "-52.97311782836914"
156+
}
157+
},
158+
"coordinates_limit": {
159+
"latitude": {
160+
"max": "5.266667",
161+
"min": "-33.733333"
162+
},
163+
"longitude": {
164+
"max": "-28.85",
165+
"min": "-73.75"
166+
}
167+
},
168+
"visible": true,
169+
"translations": [
170+
{
171+
"id": 30,
172+
"lc_country_id": 30,
173+
"name": "Brazil",
174+
"slug": "brazil",
175+
"locale": "en"
176+
}
177+
]
178+
}
44179
```
45180

181+
182+
46183
### Testing
47184

48-
``` bash
185+
186+
187+
``` bash
188+
49189
composer test
190+
50191
```
51192

193+
194+
52195
### Changelog
53196

197+
198+
54199
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
55200

201+
202+
56203
## Contributing
57204

205+
206+
58207
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
59208

209+
210+
60211
### Security
61212

213+
214+
62215
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
63216

217+
218+
64219
## Credits
65220

221+
222+
66223
- [Lucas Duarte](https://github.com/lwwcas)
224+
67225
- [All Contributors](../../contributors)
68226

227+
228+
69229
## License
70230

231+
232+
71233
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

0 commit comments

Comments
 (0)