Add Tags - OpenLitterMap/openlittermap-web GitHub Wiki

How to add new tags/brands

  1. 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();
  1. 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 
    ]
  1. Add translation value for the key
// we need to do this for every language.

resources/js/langs/en/litter.json

    "smoking": {
        "butts": "Cigarettes/Butts"
     }

  1. 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.