├── .env.example ├── .gitignore ├── .php_cs ├── CHANGELOG.md ├── Exports ├── csv │ ├── cities.csv │ ├── departments.csv │ └── regions.csv ├── json │ ├── cities.json │ ├── departments.json │ └── regions.json └── sql │ ├── cities.sql │ ├── departments.sql │ └── regions.sql ├── LICENSE ├── Makefile ├── README.md ├── app ├── Cities.php ├── Console │ ├── Commands │ │ ├── Builder.php │ │ └── Export.php │ └── Kernel.php ├── Departments.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Regions.php ├── Traits │ └── GeoCoding.php └── User.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── debugbar.php ├── filesystems.php ├── fixer.php ├── googlemaps.php ├── htmlmin.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── export │ ├── frenchzipcode_cities.sql │ ├── frenchzipcode_departments.sql │ └── frenchzipcode_regions.sql ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2018_06_15_223638_create_regions_table.php │ ├── 2018_06_15_224312_create_departments_table.php │ └── 2018_06_15_230754_create_cities_table.php └── seeds │ └── DatabaseSeeder.php ├── docker-compose.yml ├── docker ├── apache │ ├── httpd.conf │ ├── logs │ │ └── .gitignore │ └── vhosts │ │ └── 000-default.conf ├── mysql │ └── conf │ │ └── mysql.conf.d └── php │ └── conf │ ├── crontab │ ├── php.ini │ └── xdebug.ini ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── images │ ├── favicon.png │ ├── logo-maintenance@2x.png │ ├── logo.png │ ├── logo@2x.png │ └── social │ │ ├── share-f.jpg │ │ ├── share-gpl.jpg │ │ ├── share-gpl2c.jpg │ │ ├── share-gpl3c.jpg │ │ ├── share-gps.jpg │ │ ├── share-in.jpg │ │ ├── share-pe.jpg │ │ ├── share-pp.jpg │ │ └── share-t.jpg ├── index.php ├── robots.txt └── web.config ├── resources ├── assets │ ├── images │ │ ├── favicon.png │ │ ├── logo-maintenance@2x.png │ │ ├── logo.png │ │ ├── logo@2x.png │ │ └── social │ │ │ ├── share-f.jpg │ │ │ ├── share-gpl.jpg │ │ │ ├── share-gpl2c.jpg │ │ │ ├── share-gpl3c.jpg │ │ │ ├── share-gps.jpg │ │ │ ├── share-in.jpg │ │ │ ├── share-pe.jpg │ │ │ ├── share-pp.jpg │ │ │ └── share-t.jpg │ ├── js │ │ ├── app.js │ │ ├── bootstrap.js │ │ └── components │ │ │ └── ExampleComponent.vue │ └── sass │ │ └── app.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── builder │ ├── cities.txt │ ├── departments.txt │ └── regions.txt ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME="French-zip-code" 2 | APP_ENV=local 3 | APP_KEY=some_key_in_base64 4 | APP_DEBUG=false 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=mysql 10 | DB_PORT=3306 11 | DB_DATABASE=frenchzipcode 12 | DB_USERNAME=frenchzipcode 13 | DB_PASSWORD=frenchzipcode 14 | 15 | BROADCAST_DRIVER=null 16 | CACHE_DRIVER=file 17 | SESSION_COOKIE=frenchzipcode 18 | SESSION_DRIVER=file 19 | SESSION_LIFETIME=120 20 | SESSION_SECURE_COOKIE=true 21 | QUEUE_DRIVER=sync 22 | 23 | GOOGLE_MAPS_KEY=ADD_YOUR_SERVICE_KEY_HERE 24 | COM_URI="https://www.insee.fr/fr/information/2028040" 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/css/* 3 | /public/js/* 4 | /public/fonts/* 5 | /public/mix-* 6 | /public/hot 7 | /public/storage 8 | /storage/*.key 9 | /vendor 10 | /.idea 11 | /.vagrant 12 | Homestead.json 13 | Homestead.yaml 14 | npm-debug.log 15 | yarn-error.log 16 | .env 17 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | notPath('bootstrap/cache') 4 | ->notPath('node_modules') 5 | ->notPath('storage') 6 | ->notPath('vendor') 7 | ->in(__DIR__) 8 | ->name('*.php') 9 | ->notName('*.blade.php') 10 | ->ignoreDotFiles(true) 11 | ->ignoreVCS(true) 12 | ; 13 | 14 | return PhpCsFixer\Config::create() 15 | ->setRules([ 16 | '@Symfony' => true, 17 | 'binary_operator_spaces' => [ 18 | 'align_double_arrow' => true 19 | ], 20 | 'array_syntax' => [ 21 | 'syntax' => 'short' 22 | ], 23 | 'linebreak_after_opening_tag' => true, 24 | 'not_operator_with_successor_space' => true, 25 | 'ordered_imports' => true, 26 | 'phpdoc_order' => true, 27 | ]) 28 | ->setFinder($finder) 29 | ; 30 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [2.0.0] - 2018-06-19 8 | Changement intégrale des données d'origine, de la méthodologie de récupération ainsi que de la structure des données. 9 | Consultez le README.md pour plus d'informations. 10 | 11 | :warning: Compatibilité avec les versions inférieures non assuré. 12 | 13 | ------------ 14 | 15 | ## [1.3.1] - 2018-05-29 16 | ### Changed 17 | - Fixing the typographic department of _Haute-Savoie_ missing the **e** for _Haute_ 18 | 19 | ## [1.3.0] - 2018-04-21 20 | ### Added 21 | - Add this changelog 22 | 23 | ### Changed 24 | - Fixing the format of postal_code in the cities (_sql, json, csv_) for: 25 | - Montrevault-sur-Èvre 26 | - Amiens 27 | 28 | ### Removed 29 | - Remove the following id in the cities for duplicate: 30 | - 3931 : Port-la-Nouvelle 31 | - 18996 : Isles-sur-Suippe 32 | - 24683 : Hénin-sur-Cojeul 33 | 34 | ## [1.2.0] - 2018-03-14 35 | ### Changed 36 | - Fixing the missing **ü** in the cities: 37 | - slug 38 | - pattern 39 | 40 | ## [1.1.0] - 2018-01-06 41 | ### Added 42 | - The following cities are missing in the list: 43 | - Aurseulles 44 | - Crolles 45 | - Mazé-Milon 46 | 47 | ### Changed 48 | - Fixing the format of name in the regions (_sql_) for: 49 | - Provence-Alpes-Côte d'Azur 50 | - Fixing the format of name in the cities (_sql, json, csv_) for: 51 | - L'Aiguillon-sur-Mer 52 | - L'Aiguillon-sur-Vie 53 | - Château-d'Olonne 54 | - L'Épine 55 | - Grand'Landes 56 | - L'Herbergement 57 | - L'Hermenault 58 | - L'Île-d'Elle 59 | - L'Île-d'Olonne 60 | - L'Île-d'Yeu 61 | - Nieul-sur-l'Autise 62 | - Noirmoutier-en-l'Île 63 | - L'Orbrie 64 | - Rives-de-l'Yon 65 | - Les Sables-d'Olonne 66 | - Saint-André-Goule-d'Oie 67 | - Saint-Michel-en-l'Herm 68 | - Ville-d'Avray 69 | - Fixing the format of postal_code in the cities (_sql, json, csv_) for: 70 | - Aurseulles 71 | - La Chapelle-Saint-Géraud 72 | - Palisse 73 | - Crolles 74 | - Férolles 75 | - Saint-Firmin-sur-Loire 76 | - Mazé-Milon 77 | - Amiens 78 | 79 | ## [1.0.1] - 2017-12-08 80 | ### Changed 81 | - Fixing the export for creating the sql cities: 82 | - **gps_lat** passed from _double(8,2)_ to _double(9,4)_ 83 | - **gps_lon** passed from _double(8,2)_ to _double(9,4)_ 84 | 85 | ## [1.0] - 2017-12-04 86 | ### Added 87 | - The first release of the data. 88 | -------------------------------------------------------------------------------- /Exports/csv/departments.csv: -------------------------------------------------------------------------------- 1 | id,region_code,code,name,slug 2 | 1,84,01,Ain,ain 3 | 2,32,02,Aisne,aisne 4 | 3,84,03,Allier,allier 5 | 4,93,04,Alpes-de-Haute-Provence,"alpes de haute provence" 6 | 5,93,05,Hautes-Alpes,"hautes alpes" 7 | 6,93,06,Alpes-Maritimes,"alpes maritimes" 8 | 7,84,07,Ardèche,ardeche 9 | 8,44,08,Ardennes,ardennes 10 | 9,76,09,Ariège,ariege 11 | 10,44,10,Aube,aube 12 | 11,76,11,Aude,aude 13 | 12,76,12,Aveyron,aveyron 14 | 13,93,13,Bouches-du-Rhône,"bouches du rhone" 15 | 14,28,14,Calvados,calvados 16 | 15,84,15,Cantal,cantal 17 | 16,75,16,Charente,charente 18 | 17,75,17,Charente-Maritime,"charente maritime" 19 | 18,24,18,Cher,cher 20 | 19,75,19,Corrèze,correze 21 | 20,27,21,Côte-d'Or,"cote dor" 22 | 21,53,22,Côtes-d'Armor,"cotes darmor" 23 | 22,75,23,Creuse,creuse 24 | 23,75,24,Dordogne,dordogne 25 | 24,27,25,Doubs,doubs 26 | 25,84,26,Drôme,drome 27 | 26,28,27,Eure,eure 28 | 27,24,28,Eure-et-Loir,"eure et loir" 29 | 28,53,29,Finistère,finistere 30 | 29,94,2A,Corse-du-Sud,"corse du sud" 31 | 30,94,2B,Haute-Corse,"haute corse" 32 | 31,76,30,Gard,gard 33 | 32,76,31,Haute-Garonne,"haute garonne" 34 | 33,76,32,Gers,gers 35 | 34,75,33,Gironde,gironde 36 | 35,76,34,Hérault,herault 37 | 36,53,35,Ille-et-Vilaine,"ille et vilaine" 38 | 37,24,36,Indre,indre 39 | 38,24,37,Indre-et-Loire,"indre et loire" 40 | 39,84,38,Isère,isere 41 | 40,27,39,Jura,jura 42 | 41,75,40,Landes,landes 43 | 42,24,41,Loir-et-Cher,"loir et cher" 44 | 43,84,42,Loire,loire 45 | 44,84,43,Haute-Loire,"haute loire" 46 | 45,52,44,Loire-Atlantique,"loire atlantique" 47 | 46,24,45,Loiret,loiret 48 | 47,76,46,Lot,lot 49 | 48,75,47,Lot-et-Garonne,"lot et garonne" 50 | 49,76,48,Lozère,lozere 51 | 50,52,49,Maine-et-Loire,"maine et loire" 52 | 51,28,50,Manche,manche 53 | 52,44,51,Marne,marne 54 | 53,44,52,Haute-Marne,"haute marne" 55 | 54,52,53,Mayenne,mayenne 56 | 55,44,54,Meurthe-et-Moselle,"meurthe et moselle" 57 | 56,44,55,Meuse,meuse 58 | 57,53,56,Morbihan,morbihan 59 | 58,44,57,Moselle,moselle 60 | 59,27,58,Nièvre,nievre 61 | 60,32,59,Nord,nord 62 | 61,32,60,Oise,oise 63 | 62,28,61,Orne,orne 64 | 63,32,62,Pas-de-Calais,"pas de calais" 65 | 64,84,63,Puy-de-Dôme,"puy de dome" 66 | 65,75,64,Pyrénées-Atlantiques,"pyrenees atlantiques" 67 | 66,76,65,Hautes-Pyrénées,"hautes pyrenees" 68 | 67,76,66,Pyrénées-Orientales,"pyrenees orientales" 69 | 68,44,67,Bas-Rhin,"bas rhin" 70 | 69,44,68,Haut-Rhin,"haut rhin" 71 | 70,84,69,Rhône,rhone 72 | 71,27,70,Haute-Saône,"haute saone" 73 | 72,27,71,Saône-et-Loire,"saone et loire" 74 | 73,52,72,Sarthe,sarthe 75 | 74,84,73,Savoie,savoie 76 | 75,84,74,Haute-Savoie,"haute savoie" 77 | 76,11,75,Paris,paris 78 | 77,28,76,Seine-Maritime,"seine maritime" 79 | 78,11,77,Seine-et-Marne,"seine et marne" 80 | 79,11,78,Yvelines,yvelines 81 | 80,75,79,Deux-Sèvres,"deux sevres" 82 | 81,32,80,Somme,somme 83 | 82,76,81,Tarn,tarn 84 | 83,76,82,Tarn-et-Garonne,"tarn et garonne" 85 | 84,93,83,Var,var 86 | 85,93,84,Vaucluse,vaucluse 87 | 86,52,85,Vendée,vendee 88 | 87,75,86,Vienne,vienne 89 | 88,75,87,Haute-Vienne,"haute vienne" 90 | 89,44,88,Vosges,vosges 91 | 90,27,89,Yonne,yonne 92 | 91,27,90,"Territoire de Belfort","territoire de belfort" 93 | 92,11,91,Essonne,essonne 94 | 93,11,92,Hauts-de-Seine,"hauts de seine" 95 | 94,11,93,Seine-Saint-Denis,"seine saint denis" 96 | 95,11,94,Val-de-Marne,"val de marne" 97 | 96,11,95,Val-d'Oise,"val doise" 98 | 97,01,971,Guadeloupe,guadeloupe 99 | 98,02,972,Martinique,martinique 100 | 99,03,973,Guyane,guyane 101 | 100,04,974,"La Réunion","la reunion" 102 | 101,06,976,Mayotte,mayotte 103 | 102,COM,975,Saint-Pierre-et-Miquelon,"saint pierre et miquelon" 104 | 103,COM,977,Saint-Barthélemy,"saint barthelemy" 105 | 104,COM,978,Saint-Martin,"saint martin" 106 | 105,COM,984,"Terres australes et antarctiques françaises","terres australes et antarctiques francaises" 107 | 106,COM,986,"Wallis et Futuna","wallis et futuna" 108 | 107,COM,987,"Polynésie française","polynesie francaise" 109 | 108,COM,988,Nouvelle-Calédonie,"nouvelle caledonie" 110 | 109,COM,989,"Île de Clipperton","ile de clipperton" 111 | -------------------------------------------------------------------------------- /Exports/csv/regions.csv: -------------------------------------------------------------------------------- 1 | id,code,name,slug 2 | 1,01,Guadeloupe,guadeloupe 3 | 2,02,Martinique,martinique 4 | 3,03,Guyane,guyane 5 | 4,04,"La Réunion","la reunion" 6 | 5,06,Mayotte,mayotte 7 | 6,11,Île-de-France,"ile de france" 8 | 7,24,"Centre-Val de Loire","centre val de loire" 9 | 8,27,Bourgogne-Franche-Comté,"bourgogne franche comte" 10 | 9,28,Normandie,normandie 11 | 10,32,Hauts-de-France,"hauts de france" 12 | 11,44,"Grand Est","grand est" 13 | 12,52,"Pays de la Loire","pays de la loire" 14 | 13,53,Bretagne,bretagne 15 | 14,75,Nouvelle-Aquitaine,"nouvelle aquitaine" 16 | 15,76,Occitanie,occitanie 17 | 16,84,Auvergne-Rhône-Alpes,"auvergne rhone alpes" 18 | 17,93,"Provence-Alpes-Côte d'Azur","provence alpes cote dazur" 19 | 18,94,Corse,corse 20 | 19,COM,"Collectivités d'Outre-Mer","collectivites doutre mer" 21 | -------------------------------------------------------------------------------- /Exports/json/departments.json: -------------------------------------------------------------------------------- 1 | [{"id":1,"region_code":"84","code":"01","name":"Ain","slug":"ain"},{"id":2,"region_code":"32","code":"02","name":"Aisne","slug":"aisne"},{"id":3,"region_code":"84","code":"03","name":"Allier","slug":"allier"},{"id":4,"region_code":"93","code":"04","name":"Alpes-de-Haute-Provence","slug":"alpes de haute provence"},{"id":5,"region_code":"93","code":"05","name":"Hautes-Alpes","slug":"hautes alpes"},{"id":6,"region_code":"93","code":"06","name":"Alpes-Maritimes","slug":"alpes maritimes"},{"id":7,"region_code":"84","code":"07","name":"Ard\u00e8che","slug":"ardeche"},{"id":8,"region_code":"44","code":"08","name":"Ardennes","slug":"ardennes"},{"id":9,"region_code":"76","code":"09","name":"Ari\u00e8ge","slug":"ariege"},{"id":10,"region_code":"44","code":"10","name":"Aube","slug":"aube"},{"id":11,"region_code":"76","code":"11","name":"Aude","slug":"aude"},{"id":12,"region_code":"76","code":"12","name":"Aveyron","slug":"aveyron"},{"id":13,"region_code":"93","code":"13","name":"Bouches-du-Rh\u00f4ne","slug":"bouches du rhone"},{"id":14,"region_code":"28","code":"14","name":"Calvados","slug":"calvados"},{"id":15,"region_code":"84","code":"15","name":"Cantal","slug":"cantal"},{"id":16,"region_code":"75","code":"16","name":"Charente","slug":"charente"},{"id":17,"region_code":"75","code":"17","name":"Charente-Maritime","slug":"charente maritime"},{"id":18,"region_code":"24","code":"18","name":"Cher","slug":"cher"},{"id":19,"region_code":"75","code":"19","name":"Corr\u00e8ze","slug":"correze"},{"id":20,"region_code":"27","code":"21","name":"C\u00f4te-d'Or","slug":"cote dor"},{"id":21,"region_code":"53","code":"22","name":"C\u00f4tes-d'Armor","slug":"cotes darmor"},{"id":22,"region_code":"75","code":"23","name":"Creuse","slug":"creuse"},{"id":23,"region_code":"75","code":"24","name":"Dordogne","slug":"dordogne"},{"id":24,"region_code":"27","code":"25","name":"Doubs","slug":"doubs"},{"id":25,"region_code":"84","code":"26","name":"Dr\u00f4me","slug":"drome"},{"id":26,"region_code":"28","code":"27","name":"Eure","slug":"eure"},{"id":27,"region_code":"24","code":"28","name":"Eure-et-Loir","slug":"eure et loir"},{"id":28,"region_code":"53","code":"29","name":"Finist\u00e8re","slug":"finistere"},{"id":29,"region_code":"94","code":"2A","name":"Corse-du-Sud","slug":"corse du sud"},{"id":30,"region_code":"94","code":"2B","name":"Haute-Corse","slug":"haute corse"},{"id":31,"region_code":"76","code":"30","name":"Gard","slug":"gard"},{"id":32,"region_code":"76","code":"31","name":"Haute-Garonne","slug":"haute garonne"},{"id":33,"region_code":"76","code":"32","name":"Gers","slug":"gers"},{"id":34,"region_code":"75","code":"33","name":"Gironde","slug":"gironde"},{"id":35,"region_code":"76","code":"34","name":"H\u00e9rault","slug":"herault"},{"id":36,"region_code":"53","code":"35","name":"Ille-et-Vilaine","slug":"ille et vilaine"},{"id":37,"region_code":"24","code":"36","name":"Indre","slug":"indre"},{"id":38,"region_code":"24","code":"37","name":"Indre-et-Loire","slug":"indre et loire"},{"id":39,"region_code":"84","code":"38","name":"Is\u00e8re","slug":"isere"},{"id":40,"region_code":"27","code":"39","name":"Jura","slug":"jura"},{"id":41,"region_code":"75","code":"40","name":"Landes","slug":"landes"},{"id":42,"region_code":"24","code":"41","name":"Loir-et-Cher","slug":"loir et cher"},{"id":43,"region_code":"84","code":"42","name":"Loire","slug":"loire"},{"id":44,"region_code":"84","code":"43","name":"Haute-Loire","slug":"haute loire"},{"id":45,"region_code":"52","code":"44","name":"Loire-Atlantique","slug":"loire atlantique"},{"id":46,"region_code":"24","code":"45","name":"Loiret","slug":"loiret"},{"id":47,"region_code":"76","code":"46","name":"Lot","slug":"lot"},{"id":48,"region_code":"75","code":"47","name":"Lot-et-Garonne","slug":"lot et garonne"},{"id":49,"region_code":"76","code":"48","name":"Loz\u00e8re","slug":"lozere"},{"id":50,"region_code":"52","code":"49","name":"Maine-et-Loire","slug":"maine et loire"},{"id":51,"region_code":"28","code":"50","name":"Manche","slug":"manche"},{"id":52,"region_code":"44","code":"51","name":"Marne","slug":"marne"},{"id":53,"region_code":"44","code":"52","name":"Haute-Marne","slug":"haute marne"},{"id":54,"region_code":"52","code":"53","name":"Mayenne","slug":"mayenne"},{"id":55,"region_code":"44","code":"54","name":"Meurthe-et-Moselle","slug":"meurthe et moselle"},{"id":56,"region_code":"44","code":"55","name":"Meuse","slug":"meuse"},{"id":57,"region_code":"53","code":"56","name":"Morbihan","slug":"morbihan"},{"id":58,"region_code":"44","code":"57","name":"Moselle","slug":"moselle"},{"id":59,"region_code":"27","code":"58","name":"Ni\u00e8vre","slug":"nievre"},{"id":60,"region_code":"32","code":"59","name":"Nord","slug":"nord"},{"id":61,"region_code":"32","code":"60","name":"Oise","slug":"oise"},{"id":62,"region_code":"28","code":"61","name":"Orne","slug":"orne"},{"id":63,"region_code":"32","code":"62","name":"Pas-de-Calais","slug":"pas de calais"},{"id":64,"region_code":"84","code":"63","name":"Puy-de-D\u00f4me","slug":"puy de dome"},{"id":65,"region_code":"75","code":"64","name":"Pyr\u00e9n\u00e9es-Atlantiques","slug":"pyrenees atlantiques"},{"id":66,"region_code":"76","code":"65","name":"Hautes-Pyr\u00e9n\u00e9es","slug":"hautes pyrenees"},{"id":67,"region_code":"76","code":"66","name":"Pyr\u00e9n\u00e9es-Orientales","slug":"pyrenees orientales"},{"id":68,"region_code":"44","code":"67","name":"Bas-Rhin","slug":"bas rhin"},{"id":69,"region_code":"44","code":"68","name":"Haut-Rhin","slug":"haut rhin"},{"id":70,"region_code":"84","code":"69","name":"Rh\u00f4ne","slug":"rhone"},{"id":71,"region_code":"27","code":"70","name":"Haute-Sa\u00f4ne","slug":"haute saone"},{"id":72,"region_code":"27","code":"71","name":"Sa\u00f4ne-et-Loire","slug":"saone et loire"},{"id":73,"region_code":"52","code":"72","name":"Sarthe","slug":"sarthe"},{"id":74,"region_code":"84","code":"73","name":"Savoie","slug":"savoie"},{"id":75,"region_code":"84","code":"74","name":"Haute-Savoie","slug":"haute savoie"},{"id":76,"region_code":"11","code":"75","name":"Paris","slug":"paris"},{"id":77,"region_code":"28","code":"76","name":"Seine-Maritime","slug":"seine maritime"},{"id":78,"region_code":"11","code":"77","name":"Seine-et-Marne","slug":"seine et marne"},{"id":79,"region_code":"11","code":"78","name":"Yvelines","slug":"yvelines"},{"id":80,"region_code":"75","code":"79","name":"Deux-S\u00e8vres","slug":"deux sevres"},{"id":81,"region_code":"32","code":"80","name":"Somme","slug":"somme"},{"id":82,"region_code":"76","code":"81","name":"Tarn","slug":"tarn"},{"id":83,"region_code":"76","code":"82","name":"Tarn-et-Garonne","slug":"tarn et garonne"},{"id":84,"region_code":"93","code":"83","name":"Var","slug":"var"},{"id":85,"region_code":"93","code":"84","name":"Vaucluse","slug":"vaucluse"},{"id":86,"region_code":"52","code":"85","name":"Vend\u00e9e","slug":"vendee"},{"id":87,"region_code":"75","code":"86","name":"Vienne","slug":"vienne"},{"id":88,"region_code":"75","code":"87","name":"Haute-Vienne","slug":"haute vienne"},{"id":89,"region_code":"44","code":"88","name":"Vosges","slug":"vosges"},{"id":90,"region_code":"27","code":"89","name":"Yonne","slug":"yonne"},{"id":91,"region_code":"27","code":"90","name":"Territoire de Belfort","slug":"territoire de belfort"},{"id":92,"region_code":"11","code":"91","name":"Essonne","slug":"essonne"},{"id":93,"region_code":"11","code":"92","name":"Hauts-de-Seine","slug":"hauts de seine"},{"id":94,"region_code":"11","code":"93","name":"Seine-Saint-Denis","slug":"seine saint denis"},{"id":95,"region_code":"11","code":"94","name":"Val-de-Marne","slug":"val de marne"},{"id":96,"region_code":"11","code":"95","name":"Val-d'Oise","slug":"val doise"},{"id":97,"region_code":"01","code":"971","name":"Guadeloupe","slug":"guadeloupe"},{"id":98,"region_code":"02","code":"972","name":"Martinique","slug":"martinique"},{"id":99,"region_code":"03","code":"973","name":"Guyane","slug":"guyane"},{"id":100,"region_code":"04","code":"974","name":"La R\u00e9union","slug":"la reunion"},{"id":101,"region_code":"06","code":"976","name":"Mayotte","slug":"mayotte"},{"id":102,"region_code":"COM","code":"975","name":"Saint-Pierre-et-Miquelon","slug":"saint pierre et miquelon"},{"id":103,"region_code":"COM","code":"977","name":"Saint-Barth\u00e9lemy","slug":"saint barthelemy"},{"id":104,"region_code":"COM","code":"978","name":"Saint-Martin","slug":"saint martin"},{"id":105,"region_code":"COM","code":"984","name":"Terres australes et antarctiques fran\u00e7aises","slug":"terres australes et antarctiques francaises"},{"id":106,"region_code":"COM","code":"986","name":"Wallis et Futuna","slug":"wallis et futuna"},{"id":107,"region_code":"COM","code":"987","name":"Polyn\u00e9sie fran\u00e7aise","slug":"polynesie francaise"},{"id":108,"region_code":"COM","code":"988","name":"Nouvelle-Cal\u00e9donie","slug":"nouvelle caledonie"},{"id":109,"region_code":"COM","code":"989","name":"\u00cele de Clipperton","slug":"ile de clipperton"}] -------------------------------------------------------------------------------- /Exports/json/regions.json: -------------------------------------------------------------------------------- 1 | [{"id":1,"code":"01","name":"Guadeloupe","slug":"guadeloupe"},{"id":2,"code":"02","name":"Martinique","slug":"martinique"},{"id":3,"code":"03","name":"Guyane","slug":"guyane"},{"id":4,"code":"04","name":"La R\u00e9union","slug":"la reunion"},{"id":5,"code":"06","name":"Mayotte","slug":"mayotte"},{"id":6,"code":"11","name":"\u00cele-de-France","slug":"ile de france"},{"id":7,"code":"24","name":"Centre-Val de Loire","slug":"centre val de loire"},{"id":8,"code":"27","name":"Bourgogne-Franche-Comt\u00e9","slug":"bourgogne franche comte"},{"id":9,"code":"28","name":"Normandie","slug":"normandie"},{"id":10,"code":"32","name":"Hauts-de-France","slug":"hauts de france"},{"id":11,"code":"44","name":"Grand Est","slug":"grand est"},{"id":12,"code":"52","name":"Pays de la Loire","slug":"pays de la loire"},{"id":13,"code":"53","name":"Bretagne","slug":"bretagne"},{"id":14,"code":"75","name":"Nouvelle-Aquitaine","slug":"nouvelle aquitaine"},{"id":15,"code":"76","name":"Occitanie","slug":"occitanie"},{"id":16,"code":"84","name":"Auvergne-Rh\u00f4ne-Alpes","slug":"auvergne rhone alpes"},{"id":17,"code":"93","name":"Provence-Alpes-C\u00f4te d'Azur","slug":"provence alpes cote dazur"},{"id":18,"code":"94","name":"Corse","slug":"corse"},{"id":19,"code":"COM","name":"Collectivit\u00e9s d'Outre-Mer","slug":"collectivites doutre mer"}] -------------------------------------------------------------------------------- /Exports/sql/departments.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: frenchzipcode 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.22 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `departments` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `departments`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `departments` ( 26 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 27 | `region_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL, 28 | `code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL, 29 | `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 30 | `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 31 | PRIMARY KEY (`id`), 32 | KEY `departments_region_code_foreign` (`region_code`), 33 | KEY `departments_code_index` (`code`), 34 | CONSTRAINT `departments_region_code_foreign` FOREIGN KEY (`region_code`) REFERENCES `regions` (`code`) ON DELETE CASCADE 35 | ) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 36 | /*!40101 SET character_set_client = @saved_cs_client */; 37 | 38 | -- 39 | -- Dumping data for table `departments` 40 | -- 41 | 42 | LOCK TABLES `departments` WRITE; 43 | /*!40000 ALTER TABLE `departments` DISABLE KEYS */; 44 | INSERT INTO `departments` VALUES (1,'84','01','Ain','ain'),(2,'32','02','Aisne','aisne'),(3,'84','03','Allier','allier'),(4,'93','04','Alpes-de-Haute-Provence','alpes de haute provence'),(5,'93','05','Hautes-Alpes','hautes alpes'),(6,'93','06','Alpes-Maritimes','alpes maritimes'),(7,'84','07','Ardèche','ardeche'),(8,'44','08','Ardennes','ardennes'),(9,'76','09','Ariège','ariege'),(10,'44','10','Aube','aube'),(11,'76','11','Aude','aude'),(12,'76','12','Aveyron','aveyron'),(13,'93','13','Bouches-du-Rhône','bouches du rhone'),(14,'28','14','Calvados','calvados'),(15,'84','15','Cantal','cantal'),(16,'75','16','Charente','charente'),(17,'75','17','Charente-Maritime','charente maritime'),(18,'24','18','Cher','cher'),(19,'75','19','Corrèze','correze'),(20,'27','21','Côte-d\'Or','cote dor'),(21,'53','22','Côtes-d\'Armor','cotes darmor'),(22,'75','23','Creuse','creuse'),(23,'75','24','Dordogne','dordogne'),(24,'27','25','Doubs','doubs'),(25,'84','26','Drôme','drome'),(26,'28','27','Eure','eure'),(27,'24','28','Eure-et-Loir','eure et loir'),(28,'53','29','Finistère','finistere'),(29,'94','2A','Corse-du-Sud','corse du sud'),(30,'94','2B','Haute-Corse','haute corse'),(31,'76','30','Gard','gard'),(32,'76','31','Haute-Garonne','haute garonne'),(33,'76','32','Gers','gers'),(34,'75','33','Gironde','gironde'),(35,'76','34','Hérault','herault'),(36,'53','35','Ille-et-Vilaine','ille et vilaine'),(37,'24','36','Indre','indre'),(38,'24','37','Indre-et-Loire','indre et loire'),(39,'84','38','Isère','isere'),(40,'27','39','Jura','jura'),(41,'75','40','Landes','landes'),(42,'24','41','Loir-et-Cher','loir et cher'),(43,'84','42','Loire','loire'),(44,'84','43','Haute-Loire','haute loire'),(45,'52','44','Loire-Atlantique','loire atlantique'),(46,'24','45','Loiret','loiret'),(47,'76','46','Lot','lot'),(48,'75','47','Lot-et-Garonne','lot et garonne'),(49,'76','48','Lozère','lozere'),(50,'52','49','Maine-et-Loire','maine et loire'),(51,'28','50','Manche','manche'),(52,'44','51','Marne','marne'),(53,'44','52','Haute-Marne','haute marne'),(54,'52','53','Mayenne','mayenne'),(55,'44','54','Meurthe-et-Moselle','meurthe et moselle'),(56,'44','55','Meuse','meuse'),(57,'53','56','Morbihan','morbihan'),(58,'44','57','Moselle','moselle'),(59,'27','58','Nièvre','nievre'),(60,'32','59','Nord','nord'),(61,'32','60','Oise','oise'),(62,'28','61','Orne','orne'),(63,'32','62','Pas-de-Calais','pas de calais'),(64,'84','63','Puy-de-Dôme','puy de dome'),(65,'75','64','Pyrénées-Atlantiques','pyrenees atlantiques'),(66,'76','65','Hautes-Pyrénées','hautes pyrenees'),(67,'76','66','Pyrénées-Orientales','pyrenees orientales'),(68,'44','67','Bas-Rhin','bas rhin'),(69,'44','68','Haut-Rhin','haut rhin'),(70,'84','69','Rhône','rhone'),(71,'27','70','Haute-Saône','haute saone'),(72,'27','71','Saône-et-Loire','saone et loire'),(73,'52','72','Sarthe','sarthe'),(74,'84','73','Savoie','savoie'),(75,'84','74','Haute-Savoie','haute savoie'),(76,'11','75','Paris','paris'),(77,'28','76','Seine-Maritime','seine maritime'),(78,'11','77','Seine-et-Marne','seine et marne'),(79,'11','78','Yvelines','yvelines'),(80,'75','79','Deux-Sèvres','deux sevres'),(81,'32','80','Somme','somme'),(82,'76','81','Tarn','tarn'),(83,'76','82','Tarn-et-Garonne','tarn et garonne'),(84,'93','83','Var','var'),(85,'93','84','Vaucluse','vaucluse'),(86,'52','85','Vendée','vendee'),(87,'75','86','Vienne','vienne'),(88,'75','87','Haute-Vienne','haute vienne'),(89,'44','88','Vosges','vosges'),(90,'27','89','Yonne','yonne'),(91,'27','90','Territoire de Belfort','territoire de belfort'),(92,'11','91','Essonne','essonne'),(93,'11','92','Hauts-de-Seine','hauts de seine'),(94,'11','93','Seine-Saint-Denis','seine saint denis'),(95,'11','94','Val-de-Marne','val de marne'),(96,'11','95','Val-d\'Oise','val doise'),(97,'01','971','Guadeloupe','guadeloupe'),(98,'02','972','Martinique','martinique'),(99,'03','973','Guyane','guyane'),(100,'04','974','La Réunion','la reunion'),(101,'06','976','Mayotte','mayotte'),(102,'COM','975','Saint-Pierre-et-Miquelon','saint pierre et miquelon'),(103,'COM','977','Saint-Barthélemy','saint barthelemy'),(104,'COM','978','Saint-Martin','saint martin'),(105,'COM','984','Terres australes et antarctiques françaises','terres australes et antarctiques francaises'),(106,'COM','986','Wallis et Futuna','wallis et futuna'),(107,'COM','987','Polynésie française','polynesie francaise'),(108,'COM','988','Nouvelle-Calédonie','nouvelle caledonie'),(109,'COM','989','Île de Clipperton','ile de clipperton'); 45 | /*!40000 ALTER TABLE `departments` ENABLE KEYS */; 46 | UNLOCK TABLES; 47 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 48 | 49 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 50 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 51 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 52 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 53 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 54 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 55 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 56 | 57 | -- Dump completed on 2018-07-05 13:51:23 58 | -------------------------------------------------------------------------------- /Exports/sql/regions.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: frenchzipcode 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.22 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `regions` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `regions`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `regions` ( 26 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 27 | `code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL, 28 | `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 29 | `slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, 30 | PRIMARY KEY (`id`), 31 | UNIQUE KEY `regions_code_unique` (`code`) 32 | ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; 33 | /*!40101 SET character_set_client = @saved_cs_client */; 34 | 35 | -- 36 | -- Dumping data for table `regions` 37 | -- 38 | 39 | LOCK TABLES `regions` WRITE; 40 | /*!40000 ALTER TABLE `regions` DISABLE KEYS */; 41 | INSERT INTO `regions` VALUES (1,'01','Guadeloupe','guadeloupe'),(2,'02','Martinique','martinique'),(3,'03','Guyane','guyane'),(4,'04','La Réunion','la reunion'),(5,'06','Mayotte','mayotte'),(6,'11','Île-de-France','ile de france'),(7,'24','Centre-Val de Loire','centre val de loire'),(8,'27','Bourgogne-Franche-Comté','bourgogne franche comte'),(9,'28','Normandie','normandie'),(10,'32','Hauts-de-France','hauts de france'),(11,'44','Grand Est','grand est'),(12,'52','Pays de la Loire','pays de la loire'),(13,'53','Bretagne','bretagne'),(14,'75','Nouvelle-Aquitaine','nouvelle aquitaine'),(15,'76','Occitanie','occitanie'),(16,'84','Auvergne-Rhône-Alpes','auvergne rhone alpes'),(17,'93','Provence-Alpes-Côte d\'Azur','provence alpes cote dazur'),(18,'94','Corse','corse'),(19,'COM','Collectivités d\'Outre-Mer','collectivites doutre mer'); 42 | /*!40000 ALTER TABLE `regions` ENABLE KEYS */; 43 | UNLOCK TABLES; 44 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 45 | 46 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 47 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 48 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 49 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 50 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 51 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 52 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 53 | 54 | -- Dump completed on 2018-07-05 13:51:23 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Stanislas Poisson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CG4NG3. 2 | # - 57PH3N H4WK1NG 3 | 4 | .DEFAULT_GOAL = help 5 | .PHONY: help start stop restart ssh build install composer node front chown-dir migration seed php-cs fix clean dist-clean db-reset queue-listen docker-prune 6 | 7 | include .env 8 | 9 | PROJECT = frenchzipcode 10 | COMPOSE = docker-compose -p $(PROJECT) 11 | RUN = $(COMPOSE) run --rm fpm 12 | EXEC = docker exec -ti $(PROJECT)_fpm_1 13 | EXPORT = docker exec $(PROJECT)_mysql_1 14 | COMPOSE_HTTP_TIMEOUT = 300 15 | 16 | help: ## Show this help 17 | @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' 18 | @echo '' 19 | 20 | start: build install ## Start the project 21 | $(COMPOSE) up -d fpm 22 | $(COMPOSE) up -d 23 | 24 | stop: ## Stop and clear the project 25 | docker ps -aq | xargs docker stop 26 | docker ps -aq | xargs docker rm 27 | docker volume ls -q | xargs docker volume rm 28 | docker network prune -f 29 | 30 | restart: stop start ## Execute stop and start 31 | 32 | ssh: ## Acces to the app 33 | @$(EXEC) bash 34 | 35 | builder: ## Build the database 36 | $(RUN) php artisan builder:build 37 | 38 | export: ## Export the build 39 | $(RUN) php artisan builder:export 40 | @$(EXPORT) sh -c 'exec mysqldump -u root --password=root $(DB_DATABASE) regions' > ./Exports/sql/regions.sql 41 | @$(EXPORT) sh -c 'exec mysqldump -u root --password=root $(DB_DATABASE) departments' > ./Exports/sql/departments.sql 42 | @$(EXPORT) sh -c 'exec mysqldump -u root --password=root $(DB_DATABASE) cities' > ./Exports/sql/cities.sql 43 | 44 | build: ## Pull and build the containers 45 | $(COMPOSE) pull --ignore-pull-failures 46 | $(COMPOSE) build --pull --force-rm 47 | 48 | install: composer node front chown-dir seed 49 | 50 | composer: ## Install or update the composer dependencies 51 | if [ ! -d vendor ]; then $(RUN) composer install --no-interaction --prefer-dist --optimize-autoloader; else $(RUN) composer dump-autoload; fi 52 | 53 | composer-install: ## Update the composer 54 | $(RUN) rm -f ./composer.lock 55 | $(RUN) composer install --no-interaction --prefer-dist --optimize-autoloader 56 | 57 | node: ## Install or update the node dependencies 58 | if [ ! -d node_modules ]; then $(RUN) npm install --ignore-engines; fi 59 | 60 | front: ## Run the buil for the front 61 | $(RUN) npm run dev 62 | 63 | chown-dir: ## Change the directory owner and access 64 | $(RUN) chgrp -R www-data /var/www/html 65 | $(RUN) chmod -R 0777 /var/www/html/docker/apache/logs/ /var/www/html/storage /var/www/html/bootstrap/cache 66 | 67 | migration: ## Artisan migrate through docker 68 | $(RUN) php artisan migrate 69 | 70 | seed: migration ## Artisan migrate then seed through docker 71 | $(RUN) php artisan db:seed 72 | 73 | php-cs: ## Run the PHP-CS-Fixer 74 | $(RUN) php artisan fixer:fix --no-interaction --dry-run --diff --using-cache=no 75 | 76 | fix: ## Run the PHP-CS-Fixer to fix the files 77 | $(RUN) php artisan fixer:fix --using-cache=no 78 | 79 | clean: ## Clean the Laravel cahce, view, config, route and delete some directories 80 | $(RUN) rm -rf public/build/* public/css/* public/js/* storage/debugbar 81 | $(RUN) php artisan cache:clear 82 | $(RUN) php artisan view:clear 83 | $(RUN) php artisan config:clear 84 | $(RUN) php artisan route:clear 85 | 86 | dist-clean: clean ## In addition to "clean" delete the node_modules and vendor directories 87 | $(RUN) rm -rf node_modules vendor/* 88 | 89 | db-reset: ## Rebuild, migrate and seed the database 90 | $(RUN) php artisan migrate:reset 91 | $(RUN) php artisan migrate 92 | $(RUN) php artisan db:seed 93 | 94 | queue-listen: ## Show the queue listen by artisan through docker 95 | $(RUN) php artisan queue:listen 96 | 97 | docker-prune: ## Prune the system 98 | docker system prune -af 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # French Zip-Code 2 | 3 | ## A propos 4 | L'objectif de ce dépôt est de maintenir une liste la plus à jour possible des régions, départements, villes et villages Français en Métropole, Département et Région d'Outre-Mer (_DROM_) et Collectivités d'Outre-Mer (_COM_). 5 | 6 | ## Origine des données 7 | Les données utilisées proviennent du site de l'INSEE : 8 | - Métropole et DROM : 9 | - [_2018-03-28_ - Régions](https://www.insee.fr/fr/information/3363419#titre-bloc-26) 10 | - [_2018-03-28_ - Départements](https://www.insee.fr/fr/information/3363419#titre-bloc-23) 11 | - [_2018-03-28_ - Villes](https://www.insee.fr/fr/information/3363419#titre-bloc-7) 12 | - COM : 13 | - [_2017-03-01_ - Régions, Départements, Villes](https://www.insee.fr/fr/information/2028040) 14 | 15 | ### Métropole et DROM :warning: 16 | Les fichiers fournit sont au format _.txt_ encodés en **ISO-8859-15** avec **CRLF**. Il convient de les convertir en **UTF-8** avec **LF**. 17 | 18 | ### COM 19 | La page indiquer est la ressource disponible, elle est donc parsée afin d'extraire la liste de entitées _Départements, villes et villages_. 20 | 21 | ## Clone, outils requis et commandes 22 | Le dépôt utilise plusieurs technologies requises sur votre système d'exploitation : 23 | - [Docker](https://www.docker.com/) afin de concevoir les environnements de travail (_apache, php7 et mysql_). 24 | - [Make](http://www.gnu.org/software/make/) afin de mettre des commandes simple à disposition (_Makefile_). 25 | 26 | - Cloner le projet dans un répertoire de votre ordinateur. 27 | - Mettez à jour les fichiers présent dans `./storage/builder` avec les nouvelles ressources de l'INSEE : 28 | - cities.txt 29 | - departments.txt 30 | - regions.txt 31 | - Editer le ficher `.env.exemple` et enregistrer le sous `.env`, modifier les différentes variables requises : 32 | - **APP_KEY** pour un bon fonctionnement de l'appli. 33 | - **GOOGLE_MAPS_KEY** une clé valide d'accès à [Google Maps API Geocoding](https://developers.google.com/maps/documentation/geocoding/start?hl=fr). 34 | - **COM_URI** si la ressource des COM de l'INSEE à changer. 35 | - Dirigez vous dans son dossier en ligne de commande. 36 | - Faite alors un `make start` qui vas lancer le projet via docker. 37 | - Une fois le projet initialisé, faite un `make builder` qui vas lancer au travers des containers docker la récupération. 38 | - Lorsque le build sera terminer, vous pourrez demander un export des données dans `./Exports` via la commande `make export`. 39 | 40 | ### Commandes make 41 | - `make help` permet de lister toutes les commandes disponible. 42 | - `make start` permet de lancer le projet. 43 | - `make stop` permet de stopper le projet. 44 | - `make restart` composition de `make stop` et `make start` permet de relancer le projet. 45 | - `make builder` permet de lancer la génération des données. 46 | - `make export` permet de lancer l'export des données générer. 47 | 48 | ## Participer 49 | Si vous le souhaitez vous pouvez participer à ce projet en améliorant le système : 50 | - De build utiliser par `php artisan builder:build` 51 | - D'export utiliser par `php artisan builder:export` 52 | 53 | ## Releases 54 | Les données sont fournit dans 3 formats (_csv, json et sql_) afin que le maximum de personnes puissent les utiliser. Les fichiers disponibles utilisent un systeme de liaison permettant de naviger facilement entre les listes utilisant les codes INSEE de l'élément cible. 55 | Vous trouverez ci-dessous les éléments listés dans chaque fichiers. 56 | 57 | ### Régions (_regions_) 58 | | Information | Clé | 59 | | ------------- | ------------- | 60 | | L'ID unique | _id_ | 61 | | Le code INSEE de la région | _code_ | 62 | | Le nom | _name_ | 63 | | L'identifiant | _slug_ | 64 | 65 | ### Départements (_departments_) 66 | | Information | Clé | 67 | | ------------- | ------------- | 68 | | L'ID unique | _id_ | 69 | | La code INSEE de la région de référence | _region_code_ | 70 | | Le code INSEE du département | _code_ | 71 | | Le nom | _name_ | 72 | | L'identifiant | _slug_ | 73 | 74 | ### Villes et villages (_cities_) 75 | | Information | Clé | 76 | | ------------- | ------------- | 77 | | L'ID unique | _id_ | 78 | | Le code INSEE du département de référence | _department_code_ | 79 | | Le code INSEE de la ville / du village | _code_ | 80 | | Le code postal | _zip_code_ | 81 | | Le nom | _name_ | 82 | | L'identifiant | _slug_ | 83 | | La latitude | _gps_lat_ | 84 | | La longitude | _gps_lng_ | 85 | 86 | ## Pourquoi ce dépôt 87 | En effet, les listes actuellement disponible sur internet ne sont visiblement pas à jour, qu'elle proviennent d'organisme tel que [data.gouv.fr](https://www.data.gouv.fr/fr/datasets/base-officielle-des-codes-postaux/) ou de site tel que [sql.sh](http://sql.sh/736-base-donnees-villes-francaises) 88 | -------------------------------------------------------------------------------- /app/Cities.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Departments', 'department_code', 'code'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Console/Commands/Builder.php: -------------------------------------------------------------------------------- 1 | '/([\d]{2})(?:\t[\d\w]+){2}(?:.*)\t(.*)/', 37 | 'departments' => '/([\d]{2})\t([\d\w]{2,3})(?:\t[\d\w]+){2}(?:.*)\t(.*)/', 38 | 'cities' => '/(?:\t|[\d]+\t){1,3}([\d\w]{2,3})\t([\d]{2,3})(?:.*)/', 39 | ]; 40 | 41 | /** 42 | * Create a new command instance. 43 | */ 44 | public function __construct() 45 | { 46 | parent::__construct(); 47 | } 48 | 49 | /** 50 | * Save a new entry of a region. 51 | * 52 | * @param array $data 53 | */ 54 | protected function newEntryRegion(array $data) 55 | { 56 | if (0 != Regions::where('code', '=', $data[1])->count()) { 57 | return false; 58 | } 59 | 60 | Regions::create([ 61 | 'code' => $data[1], 62 | 'name' => $data[2], 63 | 'slug' => str_slug($data[2], ' '), 64 | ]); 65 | } 66 | 67 | /** 68 | * Save a new entry of a department. 69 | * 70 | * @param array $data 71 | */ 72 | protected function newEntryDepartment(array $data) 73 | { 74 | if (0 != Departments::where('code', '=', $data[2])->count()) { 75 | return false; 76 | } 77 | 78 | Departments::create([ 79 | 'region_code' => $data[1], 80 | 'code' => $data[2], 81 | 'name' => $data[3], 82 | 'slug' => str_slug($data[3], ' '), 83 | ]); 84 | } 85 | 86 | /** 87 | * Save a new entry of a city. 88 | * 89 | * @param array $data 90 | */ 91 | protected function newEntryCity(array $data) 92 | { 93 | if (0 != Cities::where('insee_code', '=', $data[1].$data[2])->count()) { 94 | return false; 95 | } 96 | 97 | $response = $this->geoCodingCity($data[1].$data[2]); 98 | if (false === $response) { 99 | return false; 100 | } 101 | 102 | $multi = (1 != count($response['codes'])) ?? false; 103 | foreach ($response['codes'] as $code) { 104 | Cities::create([ 105 | 'department_code' => $data[1], 106 | 'insee_code' => $data[1].$data[2], 107 | 'zip_code' => $code, 108 | 'name' => $response['name'], 109 | 'slug' => str_slug(str_replace(["'", '"', '’'], ' ', $response['name']), ' '), 110 | 'gps_lat' => $response['lat'], 111 | 'gps_lng' => $response['lng'], 112 | 'multi' => $multi, 113 | ]); 114 | } 115 | usleep(500); 116 | } 117 | 118 | /** 119 | * Save a new entry of a city. 120 | * 121 | * @param array $data 122 | */ 123 | protected function newEntryCOMCity(string $department_code, array $data) 124 | { 125 | if (0 != Cities::where('name', '=', $data['name']) 126 | ->where('department_code', '=', $department_code) 127 | ->count()) { 128 | return false; 129 | } 130 | 131 | Cities::create([ 132 | 'department_code' => $department_code, 133 | 'zip_code' => $data['zip_code'], 134 | 'name' => $data['name'], 135 | 'slug' => str_slug(str_replace(["'", '"', '’'], ' ', $data['name']), ' '), 136 | 'gps_lat' => $data['lat'], 137 | 'gps_lng' => $data['lng'], 138 | ]); 139 | } 140 | 141 | /** 142 | * Execute the console command. 143 | * 144 | * @return mixed 145 | */ 146 | public function handle() 147 | { 148 | $file = file_get_contents('storage/builder/regions.txt'); 149 | preg_match_all($this->patterns['regions'], $file, $regions, PREG_SET_ORDER); 150 | 151 | $bar = $this->output->createProgressBar(count($regions)); 152 | 153 | foreach ($regions as $data) { 154 | $this->newEntryRegion($data); 155 | $bar->advance(); 156 | } 157 | 158 | $bar->finish(); 159 | $this->info("\n".'The regions has been generated'); 160 | 161 | $file = file_get_contents('storage/builder/departments.txt'); 162 | preg_match_all($this->patterns['departments'], $file, $departments, PREG_SET_ORDER); 163 | 164 | $bar = $this->output->createProgressBar(count($departments)); 165 | 166 | foreach ($departments as $data) { 167 | $this->newEntryDepartment($data); 168 | $bar->advance(); 169 | } 170 | 171 | $bar->finish(); 172 | $this->info("\n".'The departments has been generated'); 173 | 174 | $file = file_get_contents('storage/builder/cities.txt'); 175 | preg_match_all($this->patterns['cities'], $file, $cities, PREG_SET_ORDER); 176 | 177 | $bar = $this->output->createProgressBar(count($cities)); 178 | 179 | foreach ($cities as $data) { 180 | $this->newEntryCity($data); 181 | $bar->advance(); 182 | } 183 | 184 | $bar->finish(); 185 | $this->info("\n".'The cities has been generated'); 186 | 187 | $multiCities = Cities::where('multi', '=', 1) 188 | ->with('department') 189 | ->get(); 190 | 191 | $bar = $this->output->createProgressBar(count($multiCities)); 192 | 193 | foreach ($multiCities as $city) { 194 | $response = $this->correctCityGPS($city); 195 | if (false !== $response) { 196 | $city->gps_lat = $response['lat']; 197 | $city->gps_lng = $response['lng']; 198 | } 199 | $city->multi = 0; 200 | $city->save(); 201 | $bar->advance(); 202 | } 203 | 204 | $bar->finish(); 205 | $this->info("\n".'The cities whith multi zip-code have their GPS coordonate corrected'); 206 | 207 | $this->newEntryRegion([null, 'COM', "Collectivités d'Outre-Mer"]); 208 | 209 | $data = $this->getCOMListe(); 210 | $com_list = $data['data']; 211 | 212 | $bar = $this->output->createProgressBar($data['nbr_entries']); 213 | 214 | foreach ($com_list as $com) { 215 | $this->newEntryDepartment([null, 'COM', $com['code'], $com['title']]); 216 | $bar->advance(); 217 | 218 | $tries = 0; 219 | foreach ($com['cities'] as $city) { 220 | while( ($city_data = $this->getDataCityCOM($com['title'], $city)) === false && $tries < 3) { 221 | $tries++; 222 | usleep(500); 223 | } 224 | 225 | if (false === $city_data || null === $city_data) { 226 | $tries = 0; 227 | while( ($city_data = $this->getDataCityCOM($city)) === false && $tries < 3) { 228 | $tries++; 229 | usleep(500); 230 | } 231 | 232 | if (false === $city_data || null === $city_data) { 233 | $tries = 0; 234 | while (($city_data = $this->getDataCityCOM($com['title'])) === false && $tries < 3) { 235 | $tries++; 236 | usleep(500); 237 | } 238 | 239 | if (false === $city_data || null === $city_data) { 240 | dd($city); // Can't Find it so debug : search and patch ;) 241 | } 242 | } 243 | } 244 | 245 | $this->newEntryCOMCity($com['code'], $city_data); 246 | $bar->advance(); 247 | } 248 | } 249 | 250 | $bar->finish(); 251 | $this->info("\n".'The COM cities has been generated'); 252 | 253 | DB::statement('ALTER TABLE cities DROP COLUMN multi'); 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /app/Console/Commands/Export.php: -------------------------------------------------------------------------------- 1 | ['id', 'code', 'name', 'slug'], 29 | 'Departments' => ['id', 'region_code', 'code', 'name', 'slug'], 30 | 'Cities' => ['id', 'department_code', 'insee_code', 'zip_code', 'name', 'slug', 'gps_lat', 'gps_lng'], 31 | ]; 32 | 33 | /** 34 | * Create a new command instance. 35 | * 36 | * @return void 37 | */ 38 | public function __construct() 39 | { 40 | parent::__construct(); 41 | } 42 | 43 | protected function saveCsvTable(string $tableName, $entities) 44 | { 45 | $file= base_path('Exports/csv/'.strtolower($tableName).'.csv'); 46 | 47 | $csv = Writer::createFromPath($file, 'w'); 48 | $csv->insertOne($this->headers[$tableName]); 49 | $csv->insertAll($entities->toArray()); 50 | } 51 | 52 | protected function saveJsonTable(string $tableName, $entities) 53 | { 54 | file_put_contents(base_path('Exports/json/'.strtolower($tableName).'.json'), json_encode($entities->toArray())); 55 | } 56 | 57 | /** 58 | * Execute the console command. 59 | * 60 | * @return mixed 61 | */ 62 | public function handle() 63 | { 64 | $regions = Regions::all(); 65 | $this->saveCsvTable('Regions', $regions); 66 | $this->saveJsonTable('Regions', $regions); 67 | 68 | $departments = Departments::all(); 69 | $this->saveCsvTable('Departments', $departments); 70 | $this->saveJsonTable('Departments', $departments); 71 | 72 | $cities = Cities::all(); 73 | $this->saveCsvTable('Cities', $cities); 74 | $this->saveJsonTable('Cities', $cities); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 26 | // ->hourly(); 27 | } 28 | 29 | /** 30 | * Register the commands for the application. 31 | */ 32 | protected function commands() 33 | { 34 | $this->load(__DIR__.'/Commands'); 35 | 36 | require base_path('routes/console.php'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Departments.php: -------------------------------------------------------------------------------- 1 | belongsTo('App\Regions', 'region_code', 'code'); 40 | } 41 | 42 | /** 43 | * Get the record of the cities. 44 | * 45 | * @return \App\Cities 46 | */ 47 | public function cities() 48 | { 49 | return $this->hasMany('App\Cities', 'code', 'department_code'); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | 40 | /** 41 | * Get a validator for an incoming registration request. 42 | * 43 | * @param array $data 44 | * 45 | * @return \Illuminate\Contracts\Validation\Validator 46 | */ 47 | protected function validator(array $data) 48 | { 49 | return Validator::make($data, [ 50 | 'name' => 'required|string|max:255', 51 | 'email' => 'required|string|email|max:255|unique:users', 52 | 'password' => 'required|string|min:6|confirmed', 53 | ]); 54 | } 55 | 56 | /** 57 | * Create a new user instance after a valid registration. 58 | * 59 | * @param array $data 60 | * 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 31 | \App\Http\Middleware\EncryptCookies::class, 32 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 33 | \Illuminate\Session\Middleware\StartSession::class, 34 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 35 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 36 | \App\Http\Middleware\VerifyCsrfToken::class, 37 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 38 | ], 39 | 40 | 'api' => [ 41 | 'throttle:60,1', 42 | 'bindings', 43 | ], 44 | ]; 45 | 46 | /** 47 | * The application's route middleware. 48 | * 49 | * These middleware may be assigned to groups or used individually. 50 | * 51 | * @var array 52 | */ 53 | protected $routeMiddleware = [ 54 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 55 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 56 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 57 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 58 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 59 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 60 | ]; 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect('/home'); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'FORWARDED', 24 | Request::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', 25 | Request::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', 26 | Request::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', 27 | Request::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 16 | ]; 17 | 18 | /** 19 | * Register any authentication / authorization services. 20 | */ 21 | public function boot() 22 | { 23 | $this->registerPolicies(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | */ 24 | public function boot() 25 | { 26 | parent::boot(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 33 | 34 | $this->mapWebRoutes(); 35 | } 36 | 37 | /** 38 | * Define the "web" routes for the application. 39 | * 40 | * These routes all receive session state, CSRF protection, etc. 41 | */ 42 | protected function mapWebRoutes() 43 | { 44 | Route::middleware('web') 45 | ->namespace($this->namespace) 46 | ->group(base_path('routes/web.php')); 47 | } 48 | 49 | /** 50 | * Define the "api" routes for the application. 51 | * 52 | * These routes are typically stateless. 53 | */ 54 | protected function mapApiRoutes() 55 | { 56 | Route::prefix('api') 57 | ->middleware('api') 58 | ->namespace($this->namespace) 59 | ->group(base_path('routes/api.php')); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Regions.php: -------------------------------------------------------------------------------- 1 | hasMany('App\Departments', 'code', 'regions_code'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Traits/GeoCoding.php: -------------------------------------------------------------------------------- 1 | request('GET', 'https://geo.api.gouv.fr/communes/'.$city_code.'?fields=codesPostaux,centre&format=json&geometry=centre'); 24 | } catch (\Exception $e) { 25 | return false; 26 | } 27 | $response = json_decode($api_response->getBody()->getContents()); 28 | 29 | return [ 30 | 'name' => $response->nom, 31 | 'codes' => $response->codesPostaux, 32 | 'lat' => $response->centre->coordinates[1], 33 | 'lng' => $response->centre->coordinates[0], 34 | ]; 35 | } 36 | 37 | /** 38 | * Get the correct GPS data for a city sub-zipcode. 39 | * 40 | * @param App\Cities $address 41 | * 42 | * @return array 43 | */ 44 | public function correctCityGPS(Cities $city) 45 | { 46 | $googleMaps = new GoogleMaps(); 47 | try { 48 | $response = $googleMaps->load('geocoding') 49 | ->setParam([ 50 | 'address' => $city->zip_code.' '.$city->name.', '.$city->department->name, 51 | 'components' => [ 52 | 'country' => 'FR', 53 | ], 54 | ]) 55 | ->get(); 56 | } catch (\Exception $e) { 57 | return false; 58 | } 59 | $response = json_decode($response); 60 | 61 | if ('OK' !== $response->status) { 62 | return false; 63 | } 64 | 65 | return [ 66 | 'lat' => $response->results[0]->geometry->location->lat, 67 | 'lng' => $response->results[0]->geometry->location->lng, 68 | ]; 69 | } 70 | 71 | /** 72 | * Get the liste of all the Cities and the "Department" Name 73 | * for the COM. 74 | * 75 | * @return array 76 | */ 77 | public function getCOMListe() 78 | { 79 | $html = HtmlDomParser::file_get_html(env('COM_URI')); 80 | $liste = $html->find('ul.bloc.liste', 0)->find('li'); 81 | $data = []; 82 | $i = 0; 83 | $nbr_entries = 0; 84 | 85 | foreach ($liste as $el) { 86 | $data[$i]['title'] = $el->find('a')->innertext[0]; 87 | $data[$i]['cities'] = []; 88 | 89 | $cities = $html->find($el->find('a')->href[0].' ~ .bloc.figure', 0)->find('table tbody', 1)->find('tr'); 90 | 91 | foreach ($cities as $city) { 92 | $data[$i]['cities'][] = trim(str_replace(["(L')", '(Le)', '(La)', '(Les)'], '', $city->find('td.texte', 1)->innertext)); 93 | $data[$i]['code'] = substr(trim(str_replace([' '], '', $city->find('td.texte', 0)->innertext)), 0, 3); 94 | ++$nbr_entries; 95 | } 96 | ++$i; 97 | ++$nbr_entries; 98 | } 99 | 100 | return ['data' => $data, 'nbr_entries' => $nbr_entries]; 101 | } 102 | 103 | /** 104 | * getDataCityCOM. 105 | * 106 | * @param string $department 107 | * @param string $city 108 | * 109 | * @return array 110 | */ 111 | public function getDataCityCOM(string $department, string $city = null) 112 | { 113 | $client = new Client(); 114 | try { 115 | if (null === $city) { $sierra = $department; } 116 | else { $sierra = $city.', '.$department; } 117 | 118 | $api_response = $client->request('GET', 'https://nominatim.openstreetmap.org/search/'.$sierra.'?format=json&addressdetails=1'); 119 | } catch (\Exception $e) { 120 | return false; 121 | } 122 | $response = json_decode($api_response->getBody()->getContents()); 123 | 124 | $data = null; 125 | foreach ($response as $entry) { 126 | if (! in_array($entry->type, ['city', 'town', 'administrative', 'island', 'district', 'locality'])) { 127 | continue; 128 | } 129 | 130 | $data = [ 131 | 'name' => (null !== $city) ? $city : $sierra, 132 | 'zip_code' => isset($entry->address->postcode) ? trim(str_replace([' '], '', $entry->address->postcode)) : null, 133 | 'lat' => $entry->lat, 134 | 'lng' => $entry->lon, 135 | ]; 136 | break; 137 | } 138 | 139 | return $data; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "description": "The Laravel Framework.", 4 | "keywords": ["framework", "laravel"], 5 | "license": "MIT", 6 | "type": "project", 7 | "require": { 8 | "php": ">=7.0.0", 9 | "fideloper/proxy": "~3.3", 10 | "guzzlehttp/guzzle": "^6.0", 11 | "htmlmin/htmlmin": "^5.6", 12 | "laravel/framework": "5.5.*", 13 | "laravel/tinker": "~1.0", 14 | "alexpechkarev/google-maps": "1.0.9", 15 | "voku/simple_html_dom": "4.1.5", 16 | "voku/portable-utf8": "5.0.6", 17 | "league/csv": "^9.0" 18 | }, 19 | "require-dev": { 20 | "doctrine/dbal": "^2.7", 21 | "filp/whoops": "~2.0", 22 | "fzaninotto/faker": "~1.4", 23 | "mockery/mockery": "~1.0", 24 | "phpunit/phpunit": "~6.0", 25 | "stechstudio/laravel-php-cs-fixer": "^0.0.1", 26 | "symfony/thanks": "^1.0" 27 | }, 28 | "autoload": { 29 | "classmap": [ 30 | "database/seeds", 31 | "database/factories" 32 | ], 33 | "psr-4": { 34 | "App\\": "app/" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "psr-4": { 39 | "Tests\\": "tests/" 40 | } 41 | }, 42 | "extra": { 43 | "laravel": { 44 | "dont-discover": [ 45 | ] 46 | } 47 | }, 48 | "scripts": { 49 | "post-root-package-install": [ 50 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 51 | ], 52 | "post-create-project-cmd": [ 53 | "@php artisan key:generate" 54 | ], 55 | "post-autoload-dump": [ 56 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 57 | "@php artisan package:discover" 58 | ] 59 | }, 60 | "config": { 61 | "preferred-install": "dist", 62 | "sort-packages": true, 63 | "optimize-autoloader": true 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Application Environment 20 | |-------------------------------------------------------------------------- 21 | | 22 | | This value determines the "environment" your application is currently 23 | | running in. This may determine how you prefer to configure various 24 | | services your application utilizes. Set this in your ".env" file. 25 | | 26 | */ 27 | 28 | 'env' => env('APP_ENV', 'production'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Application Debug Mode 33 | |-------------------------------------------------------------------------- 34 | | 35 | | When your application is in debug mode, detailed error messages with 36 | | stack traces will be shown on every error that occurs within your 37 | | application. If disabled, a simple generic error page is shown. 38 | | 39 | */ 40 | 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Application URL 46 | |-------------------------------------------------------------------------- 47 | | 48 | | This URL is used by the console to properly generate URLs when using 49 | | the Artisan command line tool. You should set this to the root of 50 | | your application so that it is used when running Artisan tasks. 51 | | 52 | */ 53 | 54 | 'url' => env('APP_URL', 'http://localhost'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Application Timezone 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Here you may specify the default timezone for your application, which 62 | | will be used by the PHP date and date-time functions. We have gone 63 | | ahead and set this to a sensible default for you out of the box. 64 | | 65 | */ 66 | 67 | 'timezone' => env('APP_TIMEZONE', 'UTC'), 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Application Locale Configuration 72 | |-------------------------------------------------------------------------- 73 | | 74 | | The application locale determines the default locale that will be used 75 | | by the translation service provider. You are free to set this value 76 | | to any of the locales which will be supported by the application. 77 | | 78 | */ 79 | 80 | 'locale' => env('APP_LOCALE', 'en'), 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Application Fallback Locale 85 | |-------------------------------------------------------------------------- 86 | | 87 | | The fallback locale determines the locale to use when the current one 88 | | is not available. You may change the value to correspond to any of 89 | | the language folders that are provided through your application. 90 | | 91 | */ 92 | 93 | 'fallback_locale' => 'en', 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Encryption Key 98 | |-------------------------------------------------------------------------- 99 | | 100 | | This key is used by the Illuminate encrypter service and should be set 101 | | to a random, 32 character string, otherwise these encrypted strings 102 | | will not be safe. Please do this before deploying an application! 103 | | 104 | */ 105 | 106 | 'key' => env('APP_KEY'), 107 | 108 | 'cipher' => 'AES-256-CBC', 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Logging Configuration 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may configure the log settings for your application. Out of 116 | | the box, Laravel uses the Monolog PHP logging library. This gives 117 | | you a variety of powerful log handlers / formatters to utilize. 118 | | 119 | | Available Settings: "single", "daily", "syslog", "errorlog" 120 | | 121 | */ 122 | 123 | 'log' => env('APP_LOG', 'single'), 124 | 125 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Autoloaded Service Providers 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service providers listed here will be automatically loaded on the 133 | | request to your application. Feel free to add your own services to 134 | | this array to grant expanded functionality to your applications. 135 | | 136 | */ 137 | 138 | 'providers' => [ 139 | /* 140 | * Laravel Framework Service Providers... 141 | */ 142 | Illuminate\Auth\AuthServiceProvider::class, 143 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 144 | Illuminate\Bus\BusServiceProvider::class, 145 | Illuminate\Cache\CacheServiceProvider::class, 146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 147 | Illuminate\Cookie\CookieServiceProvider::class, 148 | Illuminate\Database\DatabaseServiceProvider::class, 149 | Illuminate\Encryption\EncryptionServiceProvider::class, 150 | Illuminate\Filesystem\FilesystemServiceProvider::class, 151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 152 | Illuminate\Hashing\HashServiceProvider::class, 153 | Illuminate\Mail\MailServiceProvider::class, 154 | Illuminate\Notifications\NotificationServiceProvider::class, 155 | Illuminate\Pagination\PaginationServiceProvider::class, 156 | Illuminate\Pipeline\PipelineServiceProvider::class, 157 | Illuminate\Queue\QueueServiceProvider::class, 158 | Illuminate\Redis\RedisServiceProvider::class, 159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 160 | Illuminate\Session\SessionServiceProvider::class, 161 | Illuminate\Translation\TranslationServiceProvider::class, 162 | Illuminate\Validation\ValidationServiceProvider::class, 163 | Illuminate\View\ViewServiceProvider::class, 164 | 165 | /* 166 | * Package Service Providers... 167 | */ 168 | GoogleMaps\ServiceProvider\GoogleMapsServiceProvider::class, 169 | 170 | /* 171 | * Application Service Providers... 172 | */ 173 | App\Providers\AppServiceProvider::class, 174 | App\Providers\AuthServiceProvider::class, 175 | // App\Providers\BroadcastServiceProvider::class, 176 | App\Providers\EventServiceProvider::class, 177 | App\Providers\RouteServiceProvider::class, 178 | STS\Fixer\FixerServiceProvider::class, 179 | ], 180 | 181 | /* 182 | |-------------------------------------------------------------------------- 183 | | Class Aliases 184 | |-------------------------------------------------------------------------- 185 | | 186 | | This array of class aliases will be registered when this application 187 | | is started. However, feel free to register as many as you wish as 188 | | the aliases are "lazy" loaded so they don't hinder performance. 189 | | 190 | */ 191 | 192 | 'aliases' => [ 193 | 'App' => Illuminate\Support\Facades\App::class, 194 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 195 | 'Auth' => Illuminate\Support\Facades\Auth::class, 196 | 'Blade' => Illuminate\Support\Facades\Blade::class, 197 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 198 | 'Bus' => Illuminate\Support\Facades\Bus::class, 199 | 'Cache' => Illuminate\Support\Facades\Cache::class, 200 | 'Config' => Illuminate\Support\Facades\Config::class, 201 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 202 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 203 | 'DB' => Illuminate\Support\Facades\DB::class, 204 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 205 | 'Event' => Illuminate\Support\Facades\Event::class, 206 | 'File' => Illuminate\Support\Facades\File::class, 207 | 'Gate' => Illuminate\Support\Facades\Gate::class, 208 | 'Hash' => Illuminate\Support\Facades\Hash::class, 209 | 'Lang' => Illuminate\Support\Facades\Lang::class, 210 | 'Log' => Illuminate\Support\Facades\Log::class, 211 | 'Mail' => Illuminate\Support\Facades\Mail::class, 212 | 'Notification' => Illuminate\Support\Facades\Notification::class, 213 | 'Password' => Illuminate\Support\Facades\Password::class, 214 | 'Queue' => Illuminate\Support\Facades\Queue::class, 215 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 216 | 'Redis' => Illuminate\Support\Facades\Redis::class, 217 | 'Request' => Illuminate\Support\Facades\Request::class, 218 | 'Response' => Illuminate\Support\Facades\Response::class, 219 | 'Route' => Illuminate\Support\Facades\Route::class, 220 | 'Schema' => Illuminate\Support\Facades\Schema::class, 221 | 'Session' => Illuminate\Support\Facades\Session::class, 222 | 'Storage' => Illuminate\Support\Facades\Storage::class, 223 | 'URL' => Illuminate\Support\Facades\URL::class, 224 | 'Validator' => Illuminate\Support\Facades\Validator::class, 225 | 'View' => Illuminate\Support\Facades\View::class, 226 | 'GoogleMaps' => GoogleMaps\Facade\GoogleMapsFacade::class, 227 | ], 228 | ]; 229 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'guard' => 'web', 17 | 'passwords' => 'users', 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Authentication Guards 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Next, you may define every authentication guard for your application. 26 | | Of course, a great default configuration has been defined for you 27 | | here which uses session storage and the Eloquent user provider. 28 | | 29 | | All authentication drivers have a user provider. This defines how the 30 | | users are actually retrieved out of your database or other storage 31 | | mechanisms used by this application to persist your user's data. 32 | | 33 | | Supported: "session", "token" 34 | | 35 | */ 36 | 37 | 'guards' => [ 38 | 'web' => [ 39 | 'driver' => 'session', 40 | 'provider' => 'users', 41 | ], 42 | 43 | 'api' => [ 44 | 'driver' => 'token', 45 | 'provider' => 'users', 46 | ], 47 | ], 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | User Providers 52 | |-------------------------------------------------------------------------- 53 | | 54 | | All authentication drivers have a user provider. This defines how the 55 | | users are actually retrieved out of your database or other storage 56 | | mechanisms used by this application to persist your user's data. 57 | | 58 | | If you have multiple user tables or models you may configure multiple 59 | | sources which represent each model / table. These sources may then 60 | | be assigned to any extra authentication guards you have defined. 61 | | 62 | | Supported: "database", "eloquent" 63 | | 64 | */ 65 | 66 | 'providers' => [ 67 | 'users' => [ 68 | 'driver' => 'eloquent', 69 | 'model' => App\User::class, 70 | ], 71 | 72 | // 'users' => [ 73 | // 'driver' => 'database', 74 | // 'table' => 'users', 75 | // ], 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Resetting Passwords 81 | |-------------------------------------------------------------------------- 82 | | 83 | | You may specify multiple password reset configurations if you have more 84 | | than one user table or model in the application and you want to have 85 | | separate password reset settings based on the specific user types. 86 | | 87 | | The expire time is the number of minutes that the reset token should be 88 | | considered valid. This security feature keeps tokens short-lived so 89 | | they have less time to be guessed. You may change this as needed. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => 'password_resets', 97 | 'expire' => 60, 98 | ], 99 | ], 100 | ]; 101 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Broadcast Connections 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may define all of the broadcast connections that will be used 25 | | to broadcast events to other systems or over websockets. Samples of 26 | | each available type of connection are provided inside this array. 27 | | 28 | */ 29 | 30 | 'connections' => [ 31 | 'pusher' => [ 32 | 'driver' => 'pusher', 33 | 'key' => env('PUSHER_APP_KEY'), 34 | 'secret' => env('PUSHER_APP_SECRET'), 35 | 'app_id' => env('PUSHER_APP_ID'), 36 | 'options' => [ 37 | 'cluster' => env('PUSHER_APP_CLUSTER'), 38 | 'encrypted' => true, 39 | ], 40 | ], 41 | 42 | 'redis' => [ 43 | 'driver' => 'redis', 44 | 'connection' => 'default', 45 | ], 46 | 47 | 'log' => [ 48 | 'driver' => 'log', 49 | ], 50 | 51 | 'null' => [ 52 | 'driver' => 'null', 53 | ], 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Cache Stores 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may define all of the cache "stores" for your application as 25 | | well as their drivers. You may even define multiple stores for the 26 | | same cache driver to group types of items stored in your caches. 27 | | 28 | */ 29 | 30 | 'stores' => [ 31 | 'apc' => [ 32 | 'driver' => 'apc', 33 | ], 34 | 35 | 'array' => [ 36 | 'driver' => 'array', 37 | ], 38 | 39 | 'database' => [ 40 | 'driver' => 'database', 41 | 'table' => 'cache', 42 | 'connection' => null, 43 | ], 44 | 45 | 'file' => [ 46 | 'driver' => 'file', 47 | 'path' => storage_path('framework/cache/data'), 48 | ], 49 | 50 | 'memcached' => [ 51 | 'driver' => 'memcached', 52 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 53 | 'sasl' => [ 54 | env('MEMCACHED_USERNAME'), 55 | env('MEMCACHED_PASSWORD'), 56 | ], 57 | 'options' => [ 58 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 59 | ], 60 | 'servers' => [ 61 | [ 62 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 63 | 'port' => env('MEMCACHED_PORT', 11211), 64 | 'weight' => 100, 65 | ], 66 | ], 67 | ], 68 | 69 | 'redis' => [ 70 | 'driver' => 'redis', 71 | 'connection' => 'default', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Cache Key Prefix 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When utilizing a RAM based store such as APC or Memcached, there might 81 | | be other applications utilizing the same cache. So, we'll specify a 82 | | value to get prefixed to all our keys so we can avoid collisions. 83 | | 84 | */ 85 | 86 | 'prefix' => env( 87 | 'CACHE_PREFIX', 88 | str_slug(env('APP_NAME', 'laravel'), '_').'_cache' 89 | ), 90 | ]; 91 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Database Connections 20 | |-------------------------------------------------------------------------- 21 | | 22 | | Here are each of the database connections setup for your application. 23 | | Of course, examples of configuring each database platform that is 24 | | supported by Laravel is shown below to make development simple. 25 | | 26 | | 27 | | All database work in Laravel is done through the PHP PDO facilities 28 | | so make sure you have the driver for your particular database of 29 | | choice installed on your machine before you begin development. 30 | | 31 | */ 32 | 33 | 'connections' => [ 34 | 'sqlite' => [ 35 | 'driver' => 'sqlite', 36 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 37 | 'prefix' => '', 38 | ], 39 | 40 | 'mysql' => [ 41 | 'driver' => 'mysql', 42 | 'host' => env('DB_HOST', '127.0.0.1'), 43 | 'port' => env('DB_PORT', '3306'), 44 | 'database' => env('DB_DATABASE', 'forge'), 45 | 'username' => env('DB_USERNAME', 'forge'), 46 | 'password' => env('DB_PASSWORD', ''), 47 | 'unix_socket' => env('DB_SOCKET', ''), 48 | 'charset' => 'utf8mb4', 49 | 'collation' => 'utf8mb4_unicode_ci', 50 | 'prefix' => '', 51 | 'strict' => true, 52 | 'engine' => null, 53 | ], 54 | 55 | 'pgsql' => [ 56 | 'driver' => 'pgsql', 57 | 'host' => env('DB_HOST', '127.0.0.1'), 58 | 'port' => env('DB_PORT', '5432'), 59 | 'database' => env('DB_DATABASE', 'forge'), 60 | 'username' => env('DB_USERNAME', 'forge'), 61 | 'password' => env('DB_PASSWORD', ''), 62 | 'charset' => 'utf8', 63 | 'prefix' => '', 64 | 'schema' => 'public', 65 | 'sslmode' => 'prefer', 66 | ], 67 | 68 | 'sqlsrv' => [ 69 | 'driver' => 'sqlsrv', 70 | 'host' => env('DB_HOST', 'localhost'), 71 | 'port' => env('DB_PORT', '1433'), 72 | 'database' => env('DB_DATABASE', 'forge'), 73 | 'username' => env('DB_USERNAME', 'forge'), 74 | 'password' => env('DB_PASSWORD', ''), 75 | 'charset' => 'utf8', 76 | 'prefix' => '', 77 | ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Migration Repository Table 83 | |-------------------------------------------------------------------------- 84 | | 85 | | This table keeps track of all the migrations that have already run for 86 | | your application. Using this information, we can determine which of 87 | | the migrations on disk haven't actually been run in the database. 88 | | 89 | */ 90 | 91 | 'migrations' => 'migrations', 92 | 93 | /* 94 | |-------------------------------------------------------------------------- 95 | | Redis Databases 96 | |-------------------------------------------------------------------------- 97 | | 98 | | Redis is an open source, fast, and advanced key-value store that also 99 | | provides a richer set of commands than a typical key-value systems 100 | | such as APC or Memcached. Laravel makes it easy to dig right in. 101 | | 102 | */ 103 | 104 | 'redis' => [ 105 | 'client' => 'predis', 106 | 107 | 'default' => [ 108 | 'host' => env('REDIS_HOST', '127.0.0.1'), 109 | 'password' => env('REDIS_PASSWORD', null), 110 | 'port' => env('REDIS_PORT', 6379), 111 | 'database' => 0, 112 | ], 113 | ], 114 | ]; 115 | -------------------------------------------------------------------------------- /config/debugbar.php: -------------------------------------------------------------------------------- 1 | env('DEBUGBAR_ENABLED', null), 17 | 'except' => [ 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Storage settings 23 | |-------------------------------------------------------------------------- 24 | | 25 | | DebugBar stores data for session/ajax requests. 26 | | You can disable this, so the debugbar stores data in headers/session, 27 | | but this can cause problems with large data collectors. 28 | | By default, file storage (in the storage folder) is used. Redis and PDO 29 | | can also be used. For PDO, run the package migrations first. 30 | | 31 | */ 32 | 'storage' => [ 33 | 'enabled' => true, 34 | 'driver' => 'file', // redis, file, pdo, custom 35 | 'path' => storage_path('debugbar'), // For file driver 36 | 'connection' => null, // Leave null for default connection (Redis/PDO) 37 | 'provider' => '', // Instance of StorageInterface for custom driver 38 | ], 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Vendors 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Vendor files are included by default, but can be set to false. 46 | | This can also be set to 'js' or 'css', to only include javascript or css vendor files. 47 | | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) 48 | | and for js: jquery and and highlight.js 49 | | So if you want syntax highlighting, set it to true. 50 | | jQuery is set to not conflict with existing jQuery scripts. 51 | | 52 | */ 53 | 54 | 'include_vendors' => true, 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Capture Ajax Requests 59 | |-------------------------------------------------------------------------- 60 | | 61 | | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors), 62 | | you can use this option to disable sending the data through the headers. 63 | | 64 | | Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools. 65 | */ 66 | 67 | 'capture_ajax' => true, 68 | 'add_ajax_timing' => false, 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Custom Error Handler for Deprecated warnings 73 | |-------------------------------------------------------------------------- 74 | | 75 | | When enabled, the Debugbar shows deprecated warnings for Symfony components 76 | | in the Messages tab. 77 | | 78 | */ 79 | 'error_handler' => false, 80 | 81 | /* 82 | |-------------------------------------------------------------------------- 83 | | Clockwork integration 84 | |-------------------------------------------------------------------------- 85 | | 86 | | The Debugbar can emulate the Clockwork headers, so you can use the Chrome 87 | | Extension, without the server-side code. It uses Debugbar collectors instead. 88 | | 89 | */ 90 | 'clockwork' => false, 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | DataCollectors 95 | |-------------------------------------------------------------------------- 96 | | 97 | | Enable/disable DataCollectors 98 | | 99 | */ 100 | 101 | 'collectors' => [ 102 | 'phpinfo' => true, // Php version 103 | 'messages' => true, // Messages 104 | 'time' => true, // Time Datalogger 105 | 'memory' => true, // Memory usage 106 | 'exceptions' => true, // Exception displayer 107 | 'log' => true, // Logs from Monolog (merged in messages if enabled) 108 | 'db' => true, // Show database (PDO) queries and bindings 109 | 'views' => true, // Views with their data 110 | 'route' => true, // Current route information 111 | 'auth' => true, // Display Laravel authentication status 112 | 'gate' => true, // Display Laravel Gate checks 113 | 'session' => true, // Display session data 114 | 'symfony_request' => true, // Only one can be enabled.. 115 | 'mail' => true, // Catch mail messages 116 | 'laravel' => false, // Laravel version and environment 117 | 'events' => false, // All events fired 118 | 'default_request' => false, // Regular or special Symfony request logger 119 | 'logs' => false, // Add the latest log messages 120 | 'files' => false, // Show the included files 121 | 'config' => false, // Display config settings 122 | 'cache' => false, // Display cache events 123 | ], 124 | 125 | /* 126 | |-------------------------------------------------------------------------- 127 | | Extra options 128 | |-------------------------------------------------------------------------- 129 | | 130 | | Configure some DataCollectors 131 | | 132 | */ 133 | 134 | 'options' => [ 135 | 'auth' => [ 136 | 'show_name' => true, // Also show the users name/email in the debugbar 137 | ], 138 | 'db' => [ 139 | 'with_params' => true, // Render SQL with the parameters substituted 140 | 'backtrace' => true, // Use a backtrace to find the origin of the query in your files. 141 | 'timeline' => false, // Add the queries to the timeline 142 | 'explain' => [ // Show EXPLAIN output on queries 143 | 'enabled' => false, 144 | 'types' => ['SELECT'], // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ 145 | ], 146 | 'hints' => true, // Show hints for common mistakes 147 | ], 148 | 'mail' => [ 149 | 'full_log' => false, 150 | ], 151 | 'views' => [ 152 | 'data' => false, //Note: Can slow down the application, because the data can be quite large.. 153 | ], 154 | 'route' => [ 155 | 'label' => true, // show complete route on bar 156 | ], 157 | 'logs' => [ 158 | 'file' => null, 159 | ], 160 | 'cache' => [ 161 | 'values' => true, // collect cache values 162 | ], 163 | ], 164 | 165 | /* 166 | |-------------------------------------------------------------------------- 167 | | Inject Debugbar in Response 168 | |-------------------------------------------------------------------------- 169 | | 170 | | Usually, the debugbar is added just before , by listening to the 171 | | Response after the App is done. If you disable this, you have to add them 172 | | in your template yourself. See http://phpdebugbar.com/docs/rendering.html 173 | | 174 | */ 175 | 176 | 'inject' => true, 177 | 178 | /* 179 | |-------------------------------------------------------------------------- 180 | | DebugBar route prefix 181 | |-------------------------------------------------------------------------- 182 | | 183 | | Sometimes you want to set route prefix to be used by DebugBar to load 184 | | its resources from. Usually the need comes from misconfigured web server or 185 | | from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97 186 | | 187 | */ 188 | 'route_prefix' => '_debugbar', 189 | 190 | /* 191 | |-------------------------------------------------------------------------- 192 | | DebugBar route domain 193 | |-------------------------------------------------------------------------- 194 | | 195 | | By default DebugBar route served from the same domain that request served. 196 | | To override default domain, specify it as a non-empty value. 197 | */ 198 | 'route_domain' => null, 199 | ]; 200 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Default Cloud Filesystem Disk 20 | |-------------------------------------------------------------------------- 21 | | 22 | | Many applications store files both locally and in the cloud. For this 23 | | reason, you may specify a default "cloud" driver here. This driver 24 | | will be bound as the Cloud disk implementation in the container. 25 | | 26 | */ 27 | 28 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Filesystem Disks 33 | |-------------------------------------------------------------------------- 34 | | 35 | | Here you may configure as many filesystem "disks" as you wish, and you 36 | | may even configure multiple disks of the same driver. Defaults have 37 | | been setup for each driver as an example of the required options. 38 | | 39 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 40 | | 41 | */ 42 | 43 | 'disks' => [ 44 | 'local' => [ 45 | 'driver' => 'local', 46 | 'root' => storage_path('app'), 47 | ], 48 | 49 | 'public' => [ 50 | 'driver' => 'local', 51 | 'root' => storage_path('app/public'), 52 | 'url' => env('APP_URL').'/storage', 53 | 'visibility' => 'public', 54 | ], 55 | 56 | 's3' => [ 57 | 'driver' => 's3', 58 | 'key' => env('AWS_ACCESS_KEY_ID'), 59 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 60 | 'region' => env('AWS_DEFAULT_REGION'), 61 | 'bucket' => env('AWS_BUCKET'), 62 | ], 63 | ], 64 | ]; 65 | -------------------------------------------------------------------------------- /config/fixer.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'psr0' => false, 6 | '@PSR2' => true, 7 | 'blank_line_after_namespace' => true, 8 | 'braces' => true, 9 | 'class_definition' => true, 10 | 'elseif' => true, 11 | 'function_declaration' => true, 12 | 'indentation_type' => true, 13 | 'line_ending' => true, 14 | 'lowercase_constants' => true, 15 | 'lowercase_keywords' => true, 16 | 'method_argument_space' => [ 17 | 'ensure_fully_multiline' => true, ], 18 | 'no_break_comment' => true, 19 | 'no_closing_tag' => true, 20 | 'no_spaces_after_function_name' => true, 21 | 'no_spaces_inside_parenthesis' => true, 22 | 'no_trailing_whitespace' => true, 23 | 'no_trailing_whitespace_in_comment' => true, 24 | 'single_blank_line_at_eof' => true, 25 | 'single_class_element_per_statement' => [ 26 | 'elements' => ['property'], 27 | ], 28 | 'single_import_per_statement' => true, 29 | 'single_line_after_imports' => true, 30 | 'switch_case_semicolon_to_colon' => true, 31 | 'switch_case_space' => true, 32 | 'visibility_required' => true, 33 | 'encoding' => true, 34 | 'full_opening_tag' => true, 35 | ], 36 | ]; 37 | -------------------------------------------------------------------------------- /config/googlemaps.php: -------------------------------------------------------------------------------- 1 | env('GOOGLE_MAPS_KEY', null), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Verify SSL Peer 20 | |-------------------------------------------------------------------------- 21 | | 22 | | Will be used for all web services to verify 23 | | SSL peer (SSL certificate validation) 24 | | 25 | */ 26 | 'ssl_verify_peer' => false, 27 | 28 | /* 29 | |-------------------------------------------------------------------------- 30 | | Service URL 31 | |-------------------------------------------------------------------------- 32 | | url - web service URL 33 | | type - request type POST or GET 34 | | key - API key, if different to API key above 35 | | endpoint - boolean, indicates whenever output parameter to be used in the request or not 36 | | responseDefaultKey - specify default field value to be retruned when calling getByKey() 37 | | param - accepted request parameters 38 | | 39 | */ 40 | 41 | 'service' => [ 42 | 'geocoding' => [ 43 | 'url' => 'https://maps.googleapis.com/maps/api/geocode/', 44 | 'type' => 'GET', 45 | 'key' => null, 46 | 'endpoint' => true, 47 | 'responseDefaultKey' => 'place_id', 48 | 'param' => [ 49 | 'address' => null, 50 | 'bounds' => null, 51 | 'key' => null, 52 | 'region' => null, 53 | 'language' => null, 54 | 'result_type' => null, 55 | 'location_type' => null, 56 | 'latlng' => null, 57 | 'place_id' => null, 58 | 'components' => [ 59 | 'route' => null, 60 | 'locality' => null, 61 | 'administrative_area' => null, 62 | 'postal_code' => null, 63 | 'country' => null, 64 | ], 65 | ], 66 | ], 67 | 68 | 'directions' => [ 69 | 'url' => 'https://maps.googleapis.com/maps/api/directions/', 70 | 'type' => 'GET', 71 | 'key' => null, 72 | 'endpoint' => true, 73 | 'responseDefaultKey' => 'geocoded_waypoints', 74 | 'decodePolyline' => true, // true = decode overview_polyline.points to an array of points 75 | 'param' => [ 76 | 'origin' => null, // required 77 | 'destination' => null, // required 78 | 'mode' => null, 79 | 'waypoints' => null, 80 | 'place_id' => null, 81 | 'alternatives' => null, 82 | 'avoid' => null, 83 | 'language' => null, 84 | 'units' => null, 85 | 'region' => null, 86 | 'departure_time' => null, 87 | 'arrival_time' => null, 88 | 'transit_mode' => null, 89 | 'transit_routing_preference' => null, 90 | ], 91 | ], 92 | 93 | 'distancematrix' => [ 94 | 'url' => 'https://maps.googleapis.com/maps/api/distancematrix/', 95 | 'type' => 'GET', 96 | 'key' => null, 97 | 'endpoint' => true, 98 | 'responseDefaultKey' => 'origin_addresses', 99 | 'param' => [ 100 | 'origins' => null, 101 | 'destinations' => null, 102 | 'key' => null, 103 | 'mode' => null, 104 | 'language' => null, 105 | 'avoid' => null, 106 | 'units' => null, 107 | 'departure_time' => null, 108 | 'arrival_time' => null, 109 | 'transit_mode' => null, 110 | 'transit_routing_preference' => null, 111 | ], 112 | ], 113 | 114 | 'elevation' => [ 115 | 'url' => 'https://maps.googleapis.com/maps/api/elevation/', 116 | 'type' => 'GET', 117 | 'key' => null, 118 | 'endpoint' => true, 119 | 'responseDefaultKey' => 'elevation', 120 | 'param' => [ 121 | 'locations' => null, 122 | 'path' => null, 123 | 'samples' => null, 124 | 'key' => null, 125 | ], 126 | ], 127 | 128 | 'geolocate' => [ 129 | 'url' => 'https://www.googleapis.com/geolocation/v1/geolocate?', 130 | 'type' => 'POST', 131 | 'key' => null, 132 | 'endpoint' => false, 133 | 'responseDefaultKey' => 'location', 134 | 'param' => [ 135 | 'homeMobileCountryCode' => null, 136 | 'homeMobileNetworkCode' => null, 137 | 'radioType' => null, 138 | 'carrier' => null, 139 | 'considerIp' => null, 140 | 'cellTowers' => [ 141 | 'cellId' => null, 142 | 'locationAreaCode' => null, 143 | 'mobileCountryCode' => null, 144 | 'mobileNetworkCode' => null, 145 | 'age' => null, 146 | 'signalStrength' => null, 147 | 'timingAdvance' => null, 148 | ], 149 | 'wifiAccessPoints' => [ 150 | 'macAddress' => null, 151 | 'signalStrength' => null, 152 | 'age' => null, 153 | 'channel' => null, 154 | 'signalToNoiseRatio' => null, 155 | ], 156 | ], 157 | ], 158 | 159 | 'snapToRoads' => [ 160 | 'url' => 'https://roads.googleapis.com/v1/snapToRoads?', 161 | 'type' => 'GET', 162 | 'key' => null, 163 | 'endpoint' => false, 164 | 'responseDefaultKey' => 'snappedPoints', 165 | 'param' => [ 166 | 'locations' => null, 167 | 'path' => null, 168 | 'samples' => null, 169 | 'key' => null, 170 | ], 171 | ], 172 | 173 | 'speedLimits' => [ 174 | 'url' => 'https://roads.googleapis.com/v1/speedLimits?', 175 | 'type' => 'GET', 176 | 'key' => null, 177 | 'endpoint' => false, 178 | 'responseDefaultKey' => 'speedLimits', 179 | 'param' => [ 180 | 'path' => null, 181 | 'placeId' => null, 182 | 'units' => null, 183 | 'key' => null, 184 | ], 185 | ], 186 | 187 | 'timezone' => [ 188 | 'url' => 'https://maps.googleapis.com/maps/api/timezone/', 189 | 'type' => 'GET', 190 | 'key' => null, 191 | 'endpoint' => true, 192 | 'responseDefaultKey' => 'dstOffset', 193 | 'param' => [ 194 | 'location' => null, 195 | 'timestamp' => null, 196 | 'key' => null, 197 | 'language' => null, 198 | ], 199 | ], 200 | 201 | 'nearbysearch' => [ 202 | 'url' => 'https://maps.googleapis.com/maps/api/place/nearbysearch/', 203 | 'type' => 'GET', 204 | 'key' => null, 205 | 'endpoint' => true, 206 | 'responseDefaultKey' => 'results', 207 | 'param' => [ 208 | 'key' => null, 209 | 'location' => null, 210 | 'radius' => null, 211 | 'keyword' => null, 212 | 'language' => null, 213 | 'minprice' => null, 214 | 'maxprice' => null, 215 | 'name' => null, 216 | 'opennow' => null, 217 | 'rankby' => null, 218 | 'type' => null, // types depricated, one type may be specified 219 | 'pagetoken' => null, 220 | 'zagatselected' => null, 221 | ], 222 | ], 223 | 224 | 'textsearch' => [ 225 | 'url' => 'https://maps.googleapis.com/maps/api/place/textsearch/', 226 | 'type' => 'GET', 227 | 'key' => null, 228 | 'endpoint' => true, 229 | 'responseDefaultKey' => 'results', 230 | 'param' => [ 231 | 'key' => null, 232 | 'query' => null, 233 | 'location' => null, 234 | 'radius' => null, 235 | 'language' => null, 236 | 'minprice' => null, 237 | 'maxprice' => null, 238 | 'opennow' => null, 239 | 'type' => null, // types depricated, one type may be specified 240 | 'pagetoken' => null, 241 | 'zagatselected' => null, 242 | ], 243 | ], 244 | 245 | 'radarsearch' => [ 246 | 'url' => 'https://maps.googleapis.com/maps/api/place/radarsearch/', 247 | 'type' => 'GET', 248 | 'key' => null, 249 | 'endpoint' => true, 250 | 'responseDefaultKey' => 'geometry', 251 | 'param' => [ 252 | 'key' => null, 253 | 'radius' => null, 254 | 'location' => null, 255 | 'keyword' => null, 256 | 'minprice' => null, 257 | 'maxprice' => null, 258 | 'opennow' => null, 259 | 'name' => null, 260 | 'type' => null, // types depricated, one type may be specified 261 | 'zagatselected' => null, 262 | ], 263 | ], 264 | 265 | 'placedetails' => [ 266 | 'url' => 'https://maps.googleapis.com/maps/api/place/details/', 267 | 'type' => 'GET', 268 | 'key' => null, 269 | 'endpoint' => true, 270 | 'responseDefaultKey' => 'result', 271 | 'param' => [ 272 | 'key' => null, 273 | 'placeid' => null, 274 | 'extensions' => null, 275 | 'language' => null, 276 | ], 277 | ], 278 | 279 | 'placeadd' => [ 280 | 'url' => 'https://maps.googleapis.com/maps/api/place/add/', 281 | 'type' => 'POST', 282 | 'key' => null, 283 | 'endpoint' => true, 284 | 'responseDefaultKey' => 'place_id', 285 | 'param' => [ 286 | 'key' => null, 287 | 'accuracy' => null, 288 | 'address' => null, 289 | 'language' => null, 290 | 'location' => null, 291 | 'name' => null, 292 | 'phone_number' => null, 293 | 'types' => null, // according to docs types still required asstring param 294 | 'type' => null, // types depricated, one type may be specified 295 | 'website' => null, 296 | 'name' => null, 297 | ], 298 | ], 299 | 300 | 'placedelete' => [ 301 | 'url' => 'https://maps.googleapis.com/maps/api/place/delete/', 302 | 'type' => 'POST', 303 | 'key' => null, 304 | 'endpoint' => true, 305 | 'responseDefaultKey' => 'status', 306 | 'param' => [ 307 | 'key' => null, 308 | 'place_id' => null, 309 | ], 310 | ], 311 | 312 | 'placephoto' => [ 313 | 'url' => 'https://maps.googleapis.com/maps/api/place/photo?', 314 | 'type' => 'GET', 315 | 'key' => null, 316 | 'endpoint' => false, 317 | 'responseDefaultKey' => 'image', 318 | 'param' => [ 319 | 'key' => null, 320 | 'photoreference' => null, 321 | 'maxheight' => null, 322 | 'maxwidth' => null, 323 | ], 324 | ], 325 | 326 | 'placeautocomplete' => [ 327 | 'url' => 'https://maps.googleapis.com/maps/api/place/autocomplete/', 328 | 'type' => 'GET', 329 | 'key' => null, 330 | 'endpoint' => true, 331 | 'responseDefaultKey' => 'predictions', 332 | 'param' => [ 333 | 'key' => null, 334 | 'input' => null, 335 | 'offset' => null, 336 | 'location' => null, 337 | 'radius' => null, 338 | 'language' => null, 339 | 'types' => null, // use string as parameter 340 | 'type' => null, // types depricated, one type may be specified 341 | 'components' => null, 342 | ], 343 | ], 344 | 345 | 'placequeryautocomplete' => [ 346 | 'url' => 'https://maps.googleapis.com/maps/api/place/queryautocomplete/', 347 | 'type' => 'GET', 348 | 'key' => null, 349 | 'endpoint' => true, 350 | 'responseDefaultKey' => 'predictions', 351 | 'param' => [ 352 | 'key' => null, 353 | 'input' => null, 354 | 'offset' => null, 355 | 'location' => null, 356 | 'radius' => null, 357 | 'language' => null, 358 | ], 359 | ], 360 | ], 361 | 362 | /* 363 | |-------------------------------------------------------------------------- 364 | | End point 365 | |-------------------------------------------------------------------------- 366 | | 367 | | 368 | */ 369 | 370 | 'endpoint' => [ 371 | 'xml' => 'xml?', 372 | 'json' => 'json?', 373 | ], 374 | ]; 375 | -------------------------------------------------------------------------------- /config/htmlmin.php: -------------------------------------------------------------------------------- 1 | 7 | * (c) Raza Mehdi 8 | * 9 | * For the full copyright and license information, please view the LICENSE 10 | * file that was distributed with this source code. 11 | */ 12 | 13 | return [ 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Automatic Blade Optimizations 17 | |-------------------------------------------------------------------------- 18 | | 19 | | This option enables minification of the blade views as they are 20 | | compiled. These optimizations have little impact on php processing time 21 | | as the optimizations are only applied once and are cached. This package 22 | | will do nothing by default to allow it to be used without minifying 23 | | pages automatically. 24 | | 25 | | Default: false 26 | | 27 | */ 28 | 29 | 'blade' => env('HTML_MIN', false), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Force Blade Optimizations 34 | |-------------------------------------------------------------------------- 35 | | 36 | | This option forces blade minification on views where there such 37 | | minification may be dangerous. This should only be used if you are fully 38 | | aware of the potential issues this may cause. Obviously, this setting is 39 | | dependent on blade minification actually being enabled. 40 | | 41 | | PLEASE USE WITH CAUTION 42 | | 43 | | Default: false 44 | | 45 | */ 46 | 47 | 'force' => true, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Ignore Blade Files 52 | |-------------------------------------------------------------------------- 53 | | 54 | | Here you can specify paths, which you don't want to minify. 55 | | 56 | */ 57 | 58 | 'ignore' => [ 59 | 'resources/views/emails', 60 | 'resources/views/html', 61 | 'resources/views/notifications', 62 | 'resources/views/markdown', 63 | 'resources/views/vendor/emails', 64 | 'resources/views/vendor/html', 65 | 'resources/views/vendor/notifications', 66 | 'resources/views/vendor/markdown', 67 | ], 68 | ]; 69 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | SMTP Host Address 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may provide the host address of the SMTP server used by your 26 | | applications. A default option is provided that is compatible with 27 | | the Mailgun mail service which will provide reliable deliveries. 28 | | 29 | */ 30 | 31 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | SMTP Host Port 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This is the SMTP port used by your application to deliver e-mails to 39 | | users of the application. Like the host we have set this value to 40 | | stay compatible with the Mailgun e-mail application by default. 41 | | 42 | */ 43 | 44 | 'port' => env('MAIL_PORT', 587), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Global "From" Address 49 | |-------------------------------------------------------------------------- 50 | | 51 | | You may wish for all e-mails sent by your application to be sent from 52 | | the same address. Here, you may specify a name and address that is 53 | | used globally for all e-mails that are sent by your application. 54 | | 55 | */ 56 | 57 | 'from' => [ 58 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 59 | 'name' => env('MAIL_FROM_NAME', 'Example'), 60 | ], 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | E-Mail Encryption Protocol 65 | |-------------------------------------------------------------------------- 66 | | 67 | | Here you may specify the encryption protocol that should be used when 68 | | the application send e-mail messages. A sensible default using the 69 | | transport layer security protocol should provide great security. 70 | | 71 | */ 72 | 73 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | SMTP Server Username 78 | |-------------------------------------------------------------------------- 79 | | 80 | | If your SMTP server requires a username for authentication, you should 81 | | set it here. This will get used to authenticate with your server on 82 | | connection. You may also set the "password" value below this one. 83 | | 84 | */ 85 | 86 | 'username' => env('MAIL_USERNAME'), 87 | 88 | 'password' => env('MAIL_PASSWORD'), 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Sendmail System Path 93 | |-------------------------------------------------------------------------- 94 | | 95 | | When using the "sendmail" driver to send e-mails, we will need to know 96 | | the path to where Sendmail lives on this server. A default path has 97 | | been provided here, which will work well on most of your systems. 98 | | 99 | */ 100 | 101 | 'sendmail' => '/usr/sbin/sendmail -bs', 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Markdown Mail Settings 106 | |-------------------------------------------------------------------------- 107 | | 108 | | If you are using Markdown based email rendering, you may configure your 109 | | theme and component paths here, allowing you to customize the design 110 | | of the emails. Or, you may simply stick with the Laravel defaults! 111 | | 112 | */ 113 | 114 | 'markdown' => [ 115 | 'theme' => 'default', 116 | 117 | 'paths' => [ 118 | resource_path('views/vendor/mail'), 119 | ], 120 | ], 121 | ]; 122 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Queue Connections 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may configure the connection information for each server that 25 | | is used by your application. A default configuration has been added 26 | | for each back-end shipped with Laravel. You are free to add more. 27 | | 28 | */ 29 | 30 | 'connections' => [ 31 | 'sync' => [ 32 | 'driver' => 'sync', 33 | ], 34 | 35 | 'database' => [ 36 | 'driver' => 'database', 37 | 'table' => 'jobs', 38 | 'queue' => 'default', 39 | 'retry_after' => 90, 40 | ], 41 | 42 | 'beanstalkd' => [ 43 | 'driver' => 'beanstalkd', 44 | 'host' => 'localhost', 45 | 'queue' => 'default', 46 | 'retry_after' => 90, 47 | ], 48 | 49 | 'sqs' => [ 50 | 'driver' => 'sqs', 51 | 'key' => env('SQS_KEY', 'your-public-key'), 52 | 'secret' => env('SQS_SECRET', 'your-secret-key'), 53 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 54 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 55 | 'region' => env('SQS_REGION', 'us-east-1'), 56 | ], 57 | 58 | 'redis' => [ 59 | 'driver' => 'redis', 60 | 'connection' => 'default', 61 | 'queue' => 'default', 62 | 'retry_after' => 90, 63 | ], 64 | ], 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Failed Queue Jobs 69 | |-------------------------------------------------------------------------- 70 | | 71 | | These options configure the behavior of failed queue job logging so you 72 | | can control which database and table are used to store the jobs that 73 | | have failed. You may change them to any database / table you wish. 74 | | 75 | */ 76 | 77 | 'failed' => [ 78 | 'database' => env('DB_CONNECTION', 'mysql'), 79 | 'table' => 'failed_jobs', 80 | ], 81 | ]; 82 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'domain' => env('MAILGUN_DOMAIN'), 18 | 'secret' => env('MAILGUN_SECRET'), 19 | ], 20 | 21 | 'ses' => [ 22 | 'key' => env('SES_KEY'), 23 | 'secret' => env('SES_SECRET'), 24 | 'region' => 'us-east-1', 25 | ], 26 | 27 | 'sparkpost' => [ 28 | 'secret' => env('SPARKPOST_SECRET'), 29 | ], 30 | 31 | 'stripe' => [ 32 | 'model' => App\User::class, 33 | 'key' => env('STRIPE_KEY'), 34 | 'secret' => env('STRIPE_SECRET'), 35 | ], 36 | ]; 37 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Session Lifetime 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the number of minutes that you wish the session 26 | | to be allowed to remain idle before it expires. If you want them 27 | | to immediately expire on the browser closing, set that option. 28 | | 29 | */ 30 | 31 | 'lifetime' => env('SESSION_LIFETIME', 120), 32 | 33 | 'expire_on_close' => false, 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Session Encryption 38 | |-------------------------------------------------------------------------- 39 | | 40 | | This option allows you to easily specify that all of your session data 41 | | should be encrypted before it is stored. All encryption will be run 42 | | automatically by Laravel and you can use the Session like normal. 43 | | 44 | */ 45 | 46 | 'encrypt' => false, 47 | 48 | /* 49 | |-------------------------------------------------------------------------- 50 | | Session File Location 51 | |-------------------------------------------------------------------------- 52 | | 53 | | When using the native session driver, we need a location where session 54 | | files may be stored. A default has been set for you but a different 55 | | location may be specified. This is only needed for file sessions. 56 | | 57 | */ 58 | 59 | 'files' => storage_path('framework/sessions'), 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Session Database Connection 64 | |-------------------------------------------------------------------------- 65 | | 66 | | When using the "database" or "redis" session drivers, you may specify a 67 | | connection that should be used to manage these sessions. This should 68 | | correspond to a connection in your database configuration options. 69 | | 70 | */ 71 | 72 | 'connection' => null, 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Session Database Table 77 | |-------------------------------------------------------------------------- 78 | | 79 | | When using the "database" session driver, you may specify the table we 80 | | should use to manage the sessions. Of course, a sensible default is 81 | | provided for you; however, you are free to change this as needed. 82 | | 83 | */ 84 | 85 | 'table' => 'sessions', 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Session Cache Store 90 | |-------------------------------------------------------------------------- 91 | | 92 | | When using the "apc" or "memcached" session drivers, you may specify a 93 | | cache store that should be used for these sessions. This value must 94 | | correspond with one of the application's configured cache stores. 95 | | 96 | */ 97 | 98 | 'store' => null, 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Session Sweeping Lottery 103 | |-------------------------------------------------------------------------- 104 | | 105 | | Some session drivers must manually sweep their storage location to get 106 | | rid of old sessions from storage. Here are the chances that it will 107 | | happen on a given request. By default, the odds are 2 out of 100. 108 | | 109 | */ 110 | 111 | 'lottery' => [2, 100], 112 | 113 | /* 114 | |-------------------------------------------------------------------------- 115 | | Session Cookie Name 116 | |-------------------------------------------------------------------------- 117 | | 118 | | Here you may change the name of the cookie used to identify a session 119 | | instance by ID. The name specified here will get used every time a 120 | | new session cookie is created by the framework for every driver. 121 | | 122 | */ 123 | 124 | 'cookie' => env( 125 | 'SESSION_COOKIE', 126 | str_slug(env('APP_NAME', 'laravel'), '_').'_session' 127 | ), 128 | 129 | /* 130 | |-------------------------------------------------------------------------- 131 | | Session Cookie Path 132 | |-------------------------------------------------------------------------- 133 | | 134 | | The session cookie path determines the path for which the cookie will 135 | | be regarded as available. Typically, this will be the root path of 136 | | your application but you are free to change this when necessary. 137 | | 138 | */ 139 | 140 | 'path' => '/', 141 | 142 | /* 143 | |-------------------------------------------------------------------------- 144 | | Session Cookie Domain 145 | |-------------------------------------------------------------------------- 146 | | 147 | | Here you may change the domain of the cookie used to identify a session 148 | | in your application. This will determine which domains the cookie is 149 | | available to in your application. A sensible default has been set. 150 | | 151 | */ 152 | 153 | 'domain' => env('SESSION_DOMAIN', null), 154 | 155 | /* 156 | |-------------------------------------------------------------------------- 157 | | HTTPS Only Cookies 158 | |-------------------------------------------------------------------------- 159 | | 160 | | By setting this option to true, session cookies will only be sent back 161 | | to the server if the browser has a HTTPS connection. This will keep 162 | | the cookie from being sent to you if it can not be done securely. 163 | | 164 | */ 165 | 166 | 'secure' => env('SESSION_SECURE_COOKIE', false), 167 | 168 | /* 169 | |-------------------------------------------------------------------------- 170 | | HTTP Access Only 171 | |-------------------------------------------------------------------------- 172 | | 173 | | Setting this value to true will prevent JavaScript from accessing the 174 | | value of the cookie and the cookie will only be accessible through 175 | | the HTTP protocol. You are free to modify this option if needed. 176 | | 177 | */ 178 | 179 | 'http_only' => true, 180 | 181 | /* 182 | |-------------------------------------------------------------------------- 183 | | Same-Site Cookies 184 | |-------------------------------------------------------------------------- 185 | | 186 | | This option determines how your cookies behave when cross-site requests 187 | | take place, and can be used to mitigate CSRF attacks. By default, we 188 | | do not enable this as other CSRF protection services are in place. 189 | | 190 | | Supported: "lax", "strict" 191 | | 192 | */ 193 | 194 | 'same_site' => null, 195 | ]; 196 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 16 | resource_path('views'), 17 | ], 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Compiled View Path 22 | |-------------------------------------------------------------------------- 23 | | 24 | | This option determines where all the compiled Blade templates will be 25 | | stored for your application. Typically, this is within the storage 26 | | directory. However, as usual, you are free to change this value. 27 | | 28 | */ 29 | 30 | 'compiled' => realpath(storage_path('framework/views')), 31 | ]; 32 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/export/frenchzipcode_departments.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: frenchzipcode 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.22 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Dumping data for table `departments` 20 | -- 21 | 22 | LOCK TABLES `departments` WRITE; 23 | /*!40000 ALTER TABLE `departments` DISABLE KEYS */; 24 | INSERT INTO `departments` VALUES (1,'84','01','Ain','ain'),(2,'32','02','Aisne','aisne'),(3,'84','03','Allier','allier'),(4,'93','04','Alpes-de-Haute-Provence','alpes de haute provence'),(5,'93','05','Hautes-Alpes','hautes alpes'),(6,'93','06','Alpes-Maritimes','alpes maritimes'),(7,'84','07','Ardèche','ardeche'),(8,'44','08','Ardennes','ardennes'),(9,'76','09','Ariège','ariege'),(10,'44','10','Aube','aube'),(11,'76','11','Aude','aude'),(12,'76','12','Aveyron','aveyron'),(13,'93','13','Bouches-du-Rhône','bouches du rhone'),(14,'28','14','Calvados','calvados'),(15,'84','15','Cantal','cantal'),(16,'75','16','Charente','charente'),(17,'75','17','Charente-Maritime','charente maritime'),(18,'24','18','Cher','cher'),(19,'75','19','Corrèze','correze'),(20,'27','21','Côte-d\'Or','cote dor'),(21,'53','22','Côtes-d\'Armor','cotes darmor'),(22,'75','23','Creuse','creuse'),(23,'75','24','Dordogne','dordogne'),(24,'27','25','Doubs','doubs'),(25,'84','26','Drôme','drome'),(26,'28','27','Eure','eure'),(27,'24','28','Eure-et-Loir','eure et loir'),(28,'53','29','Finistère','finistere'),(29,'94','2A','Corse-du-Sud','corse du sud'),(30,'94','2B','Haute-Corse','haute corse'),(31,'76','30','Gard','gard'),(32,'76','31','Haute-Garonne','haute garonne'),(33,'76','32','Gers','gers'),(34,'75','33','Gironde','gironde'),(35,'76','34','Hérault','herault'),(36,'53','35','Ille-et-Vilaine','ille et vilaine'),(37,'24','36','Indre','indre'),(38,'24','37','Indre-et-Loire','indre et loire'),(39,'84','38','Isère','isere'),(40,'27','39','Jura','jura'),(41,'75','40','Landes','landes'),(42,'24','41','Loir-et-Cher','loir et cher'),(43,'84','42','Loire','loire'),(44,'84','43','Haute-Loire','haute loire'),(45,'52','44','Loire-Atlantique','loire atlantique'),(46,'24','45','Loiret','loiret'),(47,'76','46','Lot','lot'),(48,'75','47','Lot-et-Garonne','lot et garonne'),(49,'76','48','Lozère','lozere'),(50,'52','49','Maine-et-Loire','maine et loire'),(51,'28','50','Manche','manche'),(52,'44','51','Marne','marne'),(53,'44','52','Haute-Marne','haute marne'),(54,'52','53','Mayenne','mayenne'),(55,'44','54','Meurthe-et-Moselle','meurthe et moselle'),(56,'44','55','Meuse','meuse'),(57,'53','56','Morbihan','morbihan'),(58,'44','57','Moselle','moselle'),(59,'27','58','Nièvre','nievre'),(60,'32','59','Nord','nord'),(61,'32','60','Oise','oise'),(62,'28','61','Orne','orne'),(63,'32','62','Pas-de-Calais','pas de calais'),(64,'84','63','Puy-de-Dôme','puy de dome'),(65,'75','64','Pyrénées-Atlantiques','pyrenees atlantiques'),(66,'76','65','Hautes-Pyrénées','hautes pyrenees'),(67,'76','66','Pyrénées-Orientales','pyrenees orientales'),(68,'44','67','Bas-Rhin','bas rhin'),(69,'44','68','Haut-Rhin','haut rhin'),(70,'84','69','Rhône','rhone'),(71,'27','70','Haute-Saône','haute saone'),(72,'27','71','Saône-et-Loire','saone et loire'),(73,'52','72','Sarthe','sarthe'),(74,'84','73','Savoie','savoie'),(75,'84','74','Haute-Savoie','haute savoie'),(76,'11','75','Paris','paris'),(77,'28','76','Seine-Maritime','seine maritime'),(78,'11','77','Seine-et-Marne','seine et marne'),(79,'11','78','Yvelines','yvelines'),(80,'75','79','Deux-Sèvres','deux sevres'),(81,'32','80','Somme','somme'),(82,'76','81','Tarn','tarn'),(83,'76','82','Tarn-et-Garonne','tarn et garonne'),(84,'93','83','Var','var'),(85,'93','84','Vaucluse','vaucluse'),(86,'52','85','Vendée','vendee'),(87,'75','86','Vienne','vienne'),(88,'75','87','Haute-Vienne','haute vienne'),(89,'44','88','Vosges','vosges'),(90,'27','89','Yonne','yonne'),(91,'27','90','Territoire de Belfort','territoire de belfort'),(92,'11','91','Essonne','essonne'),(93,'11','92','Hauts-de-Seine','hauts de seine'),(94,'11','93','Seine-Saint-Denis','seine saint denis'),(95,'11','94','Val-de-Marne','val de marne'),(96,'11','95','Val-d\'Oise','val doise'),(97,'01','971','Guadeloupe','guadeloupe'),(98,'02','972','Martinique','martinique'),(99,'03','973','Guyane','guyane'),(100,'04','974','La Réunion','la reunion'),(101,'06','976','Mayotte','mayotte'),(102,'COM','975','Saint-Pierre-et-Miquelon','saint pierre et miquelon'),(103,'COM','977','Saint-Barthélemy','saint barthelemy'),(104,'COM','978','Saint-Martin','saint martin'),(105,'COM','984','Terres australes et antarctiques françaises','terres australes et antarctiques francaises'),(106,'COM','986','Wallis et Futuna','wallis et futuna'),(107,'COM','987','Polynésie française','polynesie francaise'),(108,'COM','988','Nouvelle-Calédonie','nouvelle caledonie'),(109,'COM','989','Île de Clipperton','ile de clipperton'); 25 | /*!40000 ALTER TABLE `departments` ENABLE KEYS */; 26 | UNLOCK TABLES; 27 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 28 | 29 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 30 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 31 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 32 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 33 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 34 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 35 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 36 | 37 | -- Dump completed on 2018-06-18 16:52:10 38 | -------------------------------------------------------------------------------- /database/export/frenchzipcode_regions.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64) 2 | -- 3 | -- Host: 127.0.0.1 Database: frenchzipcode 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.22 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Dumping data for table `regions` 20 | -- 21 | 22 | LOCK TABLES `regions` WRITE; 23 | /*!40000 ALTER TABLE `regions` DISABLE KEYS */; 24 | INSERT INTO `regions` VALUES (1,'01','Guadeloupe','guadeloupe'),(2,'02','Martinique','martinique'),(3,'03','Guyane','guyane'),(4,'04','La Réunion','la reunion'),(5,'06','Mayotte','mayotte'),(6,'11','Île-de-France','ile de france'),(7,'24','Centre-Val de Loire','centre val de loire'),(8,'27','Bourgogne-Franche-Comté','bourgogne franche comte'),(9,'28','Normandie','normandie'),(10,'32','Hauts-de-France','hauts de france'),(11,'44','Grand Est','grand est'),(12,'52','Pays de la Loire','pays de la loire'),(13,'53','Bretagne','bretagne'),(14,'75','Nouvelle-Aquitaine','nouvelle aquitaine'),(15,'76','Occitanie','occitanie'),(16,'84','Auvergne-Rhône-Alpes','auvergne rhone alpes'),(17,'93','Provence-Alpes-Côte d\'Azur','provence alpes cote dazur'),(18,'94','Corse','corse'),(19,'COM','Collectivités d\'Outre-Mer','collectivites doutre mer'); 25 | /*!40000 ALTER TABLE `regions` ENABLE KEYS */; 26 | UNLOCK TABLES; 27 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 28 | 29 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 30 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 31 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 32 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 33 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 34 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 35 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 36 | 37 | -- Dump completed on 2018-06-18 16:52:10 38 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker $faker) { 17 | return [ 18 | 'name' => $faker->name, 19 | 'email' => $faker->unique()->safeEmail, 20 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret 21 | 'remember_token' => str_random(10), 22 | ]; 23 | }); 24 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->string('password'); 19 | $table->rememberToken(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | */ 27 | public function down() 28 | { 29 | Schema::dropIfExists('users'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down() 25 | { 26 | Schema::dropIfExists('password_resets'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/migrations/2018_06_15_223638_create_regions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 16 | $table->string('code', 3)->unique(); 17 | $table->string('name', 255); 18 | $table->string('slug', 255); 19 | }); 20 | } 21 | 22 | /** 23 | * Reverse the migrations. 24 | */ 25 | public function down() 26 | { 27 | Schema::dropIfExists('regions'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /database/migrations/2018_06_15_224312_create_departments_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 16 | $table->string('region_code', 3); 17 | $table->string('code', 3)->index(); 18 | $table->string('name', 255); 19 | $table->string('slug', 255); 20 | 21 | $table->foreign('region_code') 22 | ->references('code')->on('regions') 23 | ->onDelete('cascade'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('departments'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2018_06_15_230754_create_cities_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 16 | $table->string('department_code', 3); 17 | $table->string('insee_code', 5)->nullable(); 18 | $table->string('zip_code', 5)->nullable(); 19 | $table->string('name', 255); 20 | $table->string('slug', 255); 21 | $table->float('gps_lat', 16, 14); 22 | $table->float('gps_lng', 17, 14); 23 | $table->boolean('multi')->default(false); 24 | 25 | $table->foreign('department_code') 26 | ->references('code')->on('departments') 27 | ->onDelete('cascade'); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('cities'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | httpd: 5 | image: httpd:2.4-alpine 6 | ports: 7 | - 80:80 8 | volumes_from: 9 | - fpm 10 | links: 11 | - fpm 12 | volumes: 13 | - ./docker/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro 14 | - ./docker/apache/vhosts:/usr/local/apache2/conf/vhosts:ro 15 | 16 | fpm: 17 | image: stanislasp/laravel-5-php-7.2:1.0 18 | expose: 19 | - 9000 20 | ports: 21 | - 9000:9000 22 | volumes: 23 | - ./docker/php/conf/php.ini:/usr/local/etc/php/php.ini:ro 24 | - ./docker/php/conf/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini:ro 25 | - ./docker/php/conf/crontab:/etc/cron.d/app:ro 26 | volumes: 27 | - .:/var/www/html:rw 28 | links: 29 | - mysql 30 | 31 | mysql: 32 | image: mysql:5.7 33 | ports: 34 | - 3306:3306 35 | volumes: 36 | - ./docker/mysql/conf:/etc/mysql/conf.d/custom.cnf:ro 37 | - db_data:/var/lib/mysql 38 | environment: 39 | MYSQL_ROOT_PASSWORD: root 40 | MYSQL_DATABASE: frenchzipcode 41 | MYSQL_USER: frenchzipcode 42 | MYSQL_PASSWORD: frenchzipcode 43 | 44 | volumes: 45 | db_data: 46 | driver: local 47 | -------------------------------------------------------------------------------- /docker/apache/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /docker/apache/vhosts/000-default.conf: -------------------------------------------------------------------------------- 1 | #Default Vhost Must be the last 2 | 3 | ServerName localhost 4 | 5 | DocumentRoot "/var/www/html/public" 6 | 7 | 8 | Options -Indexes +FollowSymLinks 9 | AllowOverride All 10 | 11 | 12 | ErrorLog /var/www/html/docker/apache/logs/errors.log 13 | CustomLog /var/www/html/docker/apache/logs/access.log combined 14 | 15 | 16 | SetHandler "proxy:fcgi://fpm:9000" 17 | 18 | 19 | -------------------------------------------------------------------------------- /docker/mysql/conf/mysql.conf.d: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character-set-server = utf8 3 | collation-server = utf8_unicode_ci 4 | skip-character-set-client-handshake 5 | sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 6 | -------------------------------------------------------------------------------- /docker/php/conf/crontab: -------------------------------------------------------------------------------- 1 | # ┌───────────── min (0 - 59) 2 | # │ ┌────────────── hour (0 - 23) 3 | # │ │ ┌─────────────── day of month (1 - 31) 4 | # │ │ │ ┌──────────────── month (1 - 12) 5 | # │ │ │ │ ┌───────────────── day of week (0 - 6) (0 to 6 are Sunday to 6 | # │ │ │ │ │ Saturday, or use names; 7 is also Sunday) 7 | # │ │ │ │ │ 8 | # │ │ │ │ │ 9 | # * * * * * user command to execute 10 | # * * * * * www-data . /var/www/project_env.sh; /usr/local/bin/php /var/www/html/bin/console app:clean_inactive_users >> /var/www/cron.log 2>&1 11 | * * * * * /usr/local/bin/php /var/www/html/artisan schedule:run 12 | -------------------------------------------------------------------------------- /docker/php/conf/php.ini: -------------------------------------------------------------------------------- 1 | date.timezone = "Europe/Paris" 2 | memory_limit = -1 3 | short_open_tag = Off 4 | upload_max_filesize = 8M 5 | post_max_size = 50M 6 | error_reporting = "E_ALL" 7 | log_errors = On 8 | display_errors = Off 9 | -------------------------------------------------------------------------------- /docker/php/conf/xdebug.ini: -------------------------------------------------------------------------------- 1 | zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so" 2 | xdebug.remote_enable=1 3 | xdebug.max_nesting_level=1000 4 | xdebug.remote_connect_back=1 5 | xdebug.remote_port=8000 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.17", 14 | "bootstrap-sass": "^3.3.7", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.2", 17 | "laravel-mix": "^1.0", 18 | "lodash": "^4.17.4", 19 | "vue": "^2.5.7" 20 | }, 21 | "dependencies": {} 22 | } 23 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/favicon.ico -------------------------------------------------------------------------------- /public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/favicon.png -------------------------------------------------------------------------------- /public/images/logo-maintenance@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/logo-maintenance@2x.png -------------------------------------------------------------------------------- /public/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/logo.png -------------------------------------------------------------------------------- /public/images/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/logo@2x.png -------------------------------------------------------------------------------- /public/images/social/share-f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-f.jpg -------------------------------------------------------------------------------- /public/images/social/share-gpl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-gpl.jpg -------------------------------------------------------------------------------- /public/images/social/share-gpl2c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-gpl2c.jpg -------------------------------------------------------------------------------- /public/images/social/share-gpl3c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-gpl3c.jpg -------------------------------------------------------------------------------- /public/images/social/share-gps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-gps.jpg -------------------------------------------------------------------------------- /public/images/social/share-in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-in.jpg -------------------------------------------------------------------------------- /public/images/social/share-pe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-pe.jpg -------------------------------------------------------------------------------- /public/images/social/share-pp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-pp.jpg -------------------------------------------------------------------------------- /public/images/social/share-t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/public/images/social/share-t.jpg -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | define('LARAVEL_START', microtime(true)); 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels great to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../vendor/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /resources/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/favicon.png -------------------------------------------------------------------------------- /resources/assets/images/logo-maintenance@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/logo-maintenance@2x.png -------------------------------------------------------------------------------- /resources/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/logo.png -------------------------------------------------------------------------------- /resources/assets/images/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/logo@2x.png -------------------------------------------------------------------------------- /resources/assets/images/social/share-f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-f.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-gpl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-gpl.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-gpl2c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-gpl2c.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-gpl3c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-gpl3c.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-gps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-gps.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-in.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-in.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-pe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-pe.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-pp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-pp.jpg -------------------------------------------------------------------------------- /resources/assets/images/social/share-t.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stanislas-Poisson/French-zip-code/ae489b2c00ac2604f98a00a848d62744eb314b58/resources/assets/images/social/share-t.jpg -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example-component', require('./components/ExampleComponent.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: 'your-pusher-key', 53 | // cluster: 'mt1', 54 | // encrypted: true 55 | // }); 56 | -------------------------------------------------------------------------------- /resources/assets/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 16 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 17 | ]; 18 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 16 | 'next' => 'Next »', 17 | ]; 18 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 16 | 'reset' => 'Your password has been reset!', 17 | 'sent' => 'We have e-mailed your password reset link!', 18 | 'token' => 'This password reset token is invalid.', 19 | 'user' => "We can't find a user with that e-mail address.", 20 | ]; 21 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 16 | 'active_url' => 'The :attribute is not a valid URL.', 17 | 'after' => 'The :attribute must be a date after :date.', 18 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 19 | 'alpha' => 'The :attribute may only contain letters.', 20 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 21 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 22 | 'array' => 'The :attribute must be an array.', 23 | 'before' => 'The :attribute must be a date before :date.', 24 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 25 | 'between' => [ 26 | 'numeric' => 'The :attribute must be between :min and :max.', 27 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 28 | 'string' => 'The :attribute must be between :min and :max characters.', 29 | 'array' => 'The :attribute must have between :min and :max items.', 30 | ], 31 | 'boolean' => 'The :attribute field must be true or false.', 32 | 'confirmed' => 'The :attribute confirmation does not match.', 33 | 'date' => 'The :attribute is not a valid date.', 34 | 'date_format' => 'The :attribute does not match the format :format.', 35 | 'different' => 'The :attribute and :other must be different.', 36 | 'digits' => 'The :attribute must be :digits digits.', 37 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 38 | 'dimensions' => 'The :attribute has invalid image dimensions.', 39 | 'distinct' => 'The :attribute field has a duplicate value.', 40 | 'email' => 'The :attribute must be a valid email address.', 41 | 'exists' => 'The selected :attribute is invalid.', 42 | 'file' => 'The :attribute must be a file.', 43 | 'filled' => 'The :attribute field must have a value.', 44 | 'image' => 'The :attribute must be an image.', 45 | 'in' => 'The selected :attribute is invalid.', 46 | 'in_array' => 'The :attribute field does not exist in :other.', 47 | 'integer' => 'The :attribute must be an integer.', 48 | 'ip' => 'The :attribute must be a valid IP address.', 49 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 50 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 51 | 'json' => 'The :attribute must be a valid JSON string.', 52 | 'max' => [ 53 | 'numeric' => 'The :attribute may not be greater than :max.', 54 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 55 | 'string' => 'The :attribute may not be greater than :max characters.', 56 | 'array' => 'The :attribute may not have more than :max items.', 57 | ], 58 | 'mimes' => 'The :attribute must be a file of type: :values.', 59 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 60 | 'min' => [ 61 | 'numeric' => 'The :attribute must be at least :min.', 62 | 'file' => 'The :attribute must be at least :min kilobytes.', 63 | 'string' => 'The :attribute must be at least :min characters.', 64 | 'array' => 'The :attribute must have at least :min items.', 65 | ], 66 | 'not_in' => 'The selected :attribute is invalid.', 67 | 'numeric' => 'The :attribute must be a number.', 68 | 'present' => 'The :attribute field must be present.', 69 | 'regex' => 'The :attribute format is invalid.', 70 | 'required' => 'The :attribute field is required.', 71 | 'required_if' => 'The :attribute field is required when :other is :value.', 72 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 73 | 'required_with' => 'The :attribute field is required when :values is present.', 74 | 'required_with_all' => 'The :attribute field is required when :values is present.', 75 | 'required_without' => 'The :attribute field is required when :values is not present.', 76 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 77 | 'same' => 'The :attribute and :other must match.', 78 | 'size' => [ 79 | 'numeric' => 'The :attribute must be :size.', 80 | 'file' => 'The :attribute must be :size kilobytes.', 81 | 'string' => 'The :attribute must be :size characters.', 82 | 'array' => 'The :attribute must contain :size items.', 83 | ], 84 | 'string' => 'The :attribute must be a string.', 85 | 'timezone' => 'The :attribute must be a valid zone.', 86 | 'unique' => 'The :attribute has already been taken.', 87 | 'uploaded' => 'The :attribute failed to upload.', 88 | 'url' => 'The :attribute format is invalid.', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Custom Validation Language Lines 93 | |-------------------------------------------------------------------------- 94 | | 95 | | Here you may specify custom validation messages for attributes using the 96 | | convention "attribute.rule" to name the lines. This makes it quick to 97 | | specify a specific custom language line for a given attribute rule. 98 | | 99 | */ 100 | 101 | 'custom' => [ 102 | 'attribute-name' => [ 103 | 'rule-name' => 'custom-message', 104 | ], 105 | ], 106 | 107 | /* 108 | |-------------------------------------------------------------------------- 109 | | Custom Validation Attributes 110 | |-------------------------------------------------------------------------- 111 | | 112 | | The following language lines are used to swap attribute place-holders 113 | | with something more reader friendly such as E-Mail Address instead 114 | | of "email". This simply helps us make messages a little cleaner. 115 | | 116 | */ 117 | 118 | 'attributes' => [], 119 | ]; 120 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 78 | @endif 79 | 80 |
81 |
82 | Laravel 83 |
84 | 85 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | $uri = urldecode( 9 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 10 | ); 11 | 12 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 13 | // built-in PHP web server. This provides a convenient way to test a Laravel 14 | // application without having installed a "real" web server software here. 15 | if ('/' !== $uri && file_exists(__DIR__.'/public'.$uri)) { 16 | return false; 17 | } 18 | 19 | require_once __DIR__.'/public/index.php'; 20 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/builder/departments.txt: -------------------------------------------------------------------------------- 1 | REGION DEP CHEFLIEU TNCC NCC NCCENR 2 | 84 01 01053 5 AIN Ain 3 | 32 02 02408 5 AISNE Aisne 4 | 84 03 03190 5 ALLIER Allier 5 | 93 04 04070 4 ALPES-DE-HAUTE-PROVENCE Alpes-de-Haute-Provence 6 | 93 05 05061 4 HAUTES-ALPES Hautes-Alpes 7 | 93 06 06088 4 ALPES-MARITIMES Alpes-Maritimes 8 | 84 07 07186 5 ARDECHE Ardèche 9 | 44 08 08105 4 ARDENNES Ardennes 10 | 76 09 09122 5 ARIEGE Ariège 11 | 44 10 10387 5 AUBE Aube 12 | 76 11 11069 5 AUDE Aude 13 | 76 12 12202 5 AVEYRON Aveyron 14 | 93 13 13055 4 BOUCHES-DU-RHONE Bouches-du-Rhône 15 | 28 14 14118 2 CALVADOS Calvados 16 | 84 15 15014 2 CANTAL Cantal 17 | 75 16 16015 3 CHARENTE Charente 18 | 75 17 17300 3 CHARENTE-MARITIME Charente-Maritime 19 | 24 18 18033 2 CHER Cher 20 | 75 19 19272 3 CORREZE Corrèze 21 | 27 21 21231 3 COTE-D'OR Côte-d'Or 22 | 53 22 22278 4 COTES-D'ARMOR Côtes-d'Armor 23 | 75 23 23096 3 CREUSE Creuse 24 | 75 24 24322 3 DORDOGNE Dordogne 25 | 27 25 25056 2 DOUBS Doubs 26 | 84 26 26362 3 DROME Drôme 27 | 28 27 27229 5 EURE Eure 28 | 24 28 28085 1 EURE-ET-LOIR Eure-et-Loir 29 | 53 29 29232 2 FINISTERE Finistère 30 | 94 2A 2A004 3 CORSE-DU-SUD Corse-du-Sud 31 | 94 2B 2B033 3 HAUTE-CORSE Haute-Corse 32 | 76 30 30189 2 GARD Gard 33 | 76 31 31555 3 HAUTE-GARONNE Haute-Garonne 34 | 76 32 32013 2 GERS Gers 35 | 75 33 33063 3 GIRONDE Gironde 36 | 76 34 34172 5 HERAULT Hérault 37 | 53 35 35238 1 ILLE-ET-VILAINE Ille-et-Vilaine 38 | 24 36 36044 5 INDRE Indre 39 | 24 37 37261 1 INDRE-ET-LOIRE Indre-et-Loire 40 | 84 38 38185 5 ISERE Isère 41 | 27 39 39300 2 JURA Jura 42 | 75 40 40192 4 LANDES Landes 43 | 24 41 41018 2 LOIR-ET-CHER Loir-et-Cher 44 | 84 42 42218 3 LOIRE Loire 45 | 84 43 43157 3 HAUTE-LOIRE Haute-Loire 46 | 52 44 44109 3 LOIRE-ATLANTIQUE Loire-Atlantique 47 | 24 45 45234 2 LOIRET Loiret 48 | 76 46 46042 2 LOT Lot 49 | 75 47 47001 2 LOT-ET-GARONNE Lot-et-Garonne 50 | 76 48 48095 3 LOZERE Lozère 51 | 52 49 49007 2 MAINE-ET-LOIRE Maine-et-Loire 52 | 28 50 50502 3 MANCHE Manche 53 | 44 51 51108 3 MARNE Marne 54 | 44 52 52121 3 HAUTE-MARNE Haute-Marne 55 | 52 53 53130 3 MAYENNE Mayenne 56 | 44 54 54395 0 MEURTHE-ET-MOSELLE Meurthe-et-Moselle 57 | 44 55 55029 3 MEUSE Meuse 58 | 53 56 56260 2 MORBIHAN Morbihan 59 | 44 57 57463 3 MOSELLE Moselle 60 | 27 58 58194 3 NIEVRE Nièvre 61 | 32 59 59350 2 NORD Nord 62 | 32 60 60057 5 OISE Oise 63 | 28 61 61001 5 ORNE Orne 64 | 32 62 62041 2 PAS-DE-CALAIS Pas-de-Calais 65 | 84 63 63113 2 PUY-DE-DOME Puy-de-Dôme 66 | 75 64 64445 4 PYRENEES-ATLANTIQUES Pyrénées-Atlantiques 67 | 76 65 65440 4 HAUTES-PYRENEES Hautes-Pyrénées 68 | 76 66 66136 4 PYRENEES-ORIENTALES Pyrénées-Orientales 69 | 44 67 67482 2 BAS-RHIN Bas-Rhin 70 | 44 68 68066 2 HAUT-RHIN Haut-Rhin 71 | 84 69 69123 2 RHONE Rhône 72 | 27 70 70550 3 HAUTE-SAONE Haute-Saône 73 | 27 71 71270 0 SAONE-ET-LOIRE Saône-et-Loire 74 | 52 72 72181 3 SARTHE Sarthe 75 | 84 73 73065 3 SAVOIE Savoie 76 | 84 74 74010 3 HAUTE-SAVOIE Haute-Savoie 77 | 11 75 75056 0 PARIS Paris 78 | 28 76 76540 3 SEINE-MARITIME Seine-Maritime 79 | 11 77 77288 0 SEINE-ET-MARNE Seine-et-Marne 80 | 11 78 78646 4 YVELINES Yvelines 81 | 75 79 79191 4 DEUX-SEVRES Deux-Sèvres 82 | 32 80 80021 3 SOMME Somme 83 | 76 81 81004 2 TARN Tarn 84 | 76 82 82121 2 TARN-ET-GARONNE Tarn-et-Garonne 85 | 93 83 83137 2 VAR Var 86 | 93 84 84007 2 VAUCLUSE Vaucluse 87 | 52 85 85191 3 VENDEE Vendée 88 | 75 86 86194 3 VIENNE Vienne 89 | 75 87 87085 3 HAUTE-VIENNE Haute-Vienne 90 | 44 88 88160 4 VOSGES Vosges 91 | 27 89 89024 5 YONNE Yonne 92 | 27 90 90010 2 TERRITOIRE DE BELFORT Territoire de Belfort 93 | 11 91 91228 5 ESSONNE Essonne 94 | 11 92 92050 4 HAUTS-DE-SEINE Hauts-de-Seine 95 | 11 93 93008 3 SEINE-SAINT-DENIS Seine-Saint-Denis 96 | 11 94 94028 2 VAL-DE-MARNE Val-de-Marne 97 | 11 95 95500 2 VAL-D'OISE Val-d'Oise 98 | 01 971 97105 3 GUADELOUPE Guadeloupe 99 | 02 972 97209 3 MARTINIQUE Martinique 100 | 03 973 97302 3 GUYANE Guyane 101 | 04 974 97411 0 LA REUNION La Réunion 102 | 06 976 97608 0 MAYOTTE Mayotte 103 | -------------------------------------------------------------------------------- /storage/builder/regions.txt: -------------------------------------------------------------------------------- 1 | REGION CHEFLIEU TNCC NCC NCCENR 2 | 01 97105 3 GUADELOUPE Guadeloupe 3 | 02 97209 3 MARTINIQUE Martinique 4 | 03 97302 3 GUYANE Guyane 5 | 04 97411 0 LA REUNION La Réunion 6 | 06 97608 0 MAYOTTE Mayotte 7 | 11 75056 1 ILE-DE-FRANCE Île-de-France 8 | 24 45234 2 CENTRE-VAL DE LOIRE Centre-Val de Loire 9 | 27 21231 0 BOURGOGNE-FRANCHE-COMTE Bourgogne-Franche-Comté 10 | 28 76540 0 NORMANDIE Normandie 11 | 32 59350 4 HAUTS-DE-FRANCE Hauts-de-France 12 | 44 67482 2 GRAND EST Grand Est 13 | 52 44109 4 PAYS DE LA LOIRE Pays de la Loire 14 | 53 35238 0 BRETAGNE Bretagne 15 | 75 33063 3 NOUVELLE-AQUITAINE Nouvelle-Aquitaine 16 | 76 31555 1 OCCITANIE Occitanie 17 | 84 69123 1 AUVERGNE-RHONE-ALPES Auvergne-Rhône-Alpes 18 | 93 13055 0 PROVENCE-ALPES-COTE D'AZUR Provence-Alpes-Côte d'Azur 19 | 94 2A004 0 CORSE Corse 20 | -------------------------------------------------------------------------------- /storage/debugbar/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 20 | 21 | Hash::setRounds(4); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 15 | 16 | $response->assertStatus(200); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.disableNotifications() 15 | .options({ processCssUrls: false }) 16 | .copy('resources/assets/images', 'public/images') 17 | .js('resources/assets/js/app.js', 'public/js') 18 | .sass('resources/assets/sass/app.scss', 'public/css', { 19 | includePaths: ['node_modules'] 20 | }) 21 | .version(); 22 | --------------------------------------------------------------------------------