Add Tags - OpenLitterMap/openlittermap-web GitHub Wiki
How to add new tags/brands
- Add column to category table
php artisan make:migration add_cigarette_butts_to_smoking --table=smoking
// add this to the migration
$table->integer('butts')->unsigned()->nullable();
- Update the frontend
litterkeys.js
// add new record
// increment "id"
// make sure the "key" matches the value of the column created in the migration
// Add a comment of the litter string
smoking: [
'butts', // Cigarette/Butts
]
- Add translation value for the key
// we need to do this for every language.
resources/js/langs/en/litter.json
"smoking": {
"butts": "Cigarettes/Butts"
}
- On each model, eg Smoking.php, we need to add the new tag to the
types ()
method. If you're adding a brand, do the same as above in Brand.php
.