Add tags and taggable behaviour to your Laravel app

Overview

Add tags and taggable behaviour to a Laravel app

Latest Version on Packagist MIT Licensed GitHub Workflow Status Total Downloads

This package offers taggable behaviour for your models. After the package is installed the only thing you have to do is add the HasTags trait to an Eloquent model to make it taggable.

But we didn't stop with the regular tagging capabilities you find in every package. Laravel Tags comes with batteries included. Out of the box it has support for translating tags, multiple tag types and sorting capabilities.

You'll find the documentation on https://spatie.be/docs/laravel-tags.

Here are some code examples:

// create a model with some tags
$newsItem = NewsItem::create([
   'name' => 'The Article Title',
   'tags' => ['first tag', 'second tag'], //tags will be created if they don't exist
]);

// attaching tags
$newsItem->attachTag('third tag');
$newsItem->attachTag('third tag','some_type');
$newsItem->attachTags(['fourth tag', 'fifth tag']);
$newsItem->attachTags(['fourth_tag','fifth_tag'],'some_type');

// detaching tags
$newsItem->detachTags('third tag');
$newsItem->detachTags('third tag','some_type');
$newsItem->detachTags(['fourth tag', 'fifth tag']);
$newsItem->detachTags(['fourth tag', 'fifth tag'],'some_type');

// syncing tags
$newsItem->syncTags(['first tag', 'second tag']); // all other tags on this model will be detached

// syncing tags with a type
$newsItem->syncTagsWithType(['category 1', 'category 2'], 'categories'); 
$newsItem->syncTagsWithType(['topic 1', 'topic 2'], 'topics'); 

// retrieving tags with a type
$newsItem->tagsWithType('categories'); 
$newsItem->tagsWithType('topics'); 

// retrieving models that have any of the given tags
NewsItem::withAnyTags(['first tag', 'second tag'])->get();

// retrieve models that have all of the given tags
NewsItem::withAllTags(['first tag', 'second tag'])->get();

// translating a tag
$tag = Tag::findOrCreate('my tag');
$tag->setTranslation('name', 'fr', 'mon tag');
$tag->setTranslation('name', 'nl', 'mijn tag');
$tag->save();

// getting translations
$tag->translate('name'); //returns my name
$tag->translate('name', 'fr'); //returns mon tag (optional locale param)

// convenient translations through taggable models
$newsItem->tagsTranslated();// returns tags with slug_translated and name_translated properties
$newsItem->tagsTranslated('fr');// returns tags with slug_translated and name_translated properties set for specified locale

// using tag types
$tag = Tag::findOrCreate('tag 1', 'my type');

// tags have slugs
$tag = Tag::findOrCreate('yet another tag');
$tag->slug; //returns "yet-another-tag"

// tags are sortable
$tag = Tag::findOrCreate('my tag');
$tag->order_column; //returns 1
$tag2 = Tag::findOrCreate('another tag');
$tag2->order_column; //returns 2

// manipulating the order of tags
$tag->swapOrder($anotherTag);

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Requirements

This package requires Laravel 8 or higher, PHP 8 or higher, and a database that supports json fields and MySQL compatible functions.

Installation

You can install the package via composer:

composer require spatie/laravel-tags

The package will automatically register itself.

You can publish the migration with:

php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="migrations"

After the migration has been published you can create the tags and taggables tables by running the migrations:

php artisan migrate

You can optionally publish the config file with:

php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="config"

This is the contents of the published config file:

return [

    /*
     * The given function generates a URL friendly "slug" from the tag name property before saving it.
     * Defaults to Str::slug (https://laravel.com/docs/5.8/helpers#method-str-slug)
     */
    'slugger' => null, 
];

Documentation

You'll find the documentation on https://docs.spatie.be/laravel-tags/v2.

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the laravel-tags package? Feel free to create an issue on GitHub, we'll try to address it as soon as possible.

If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.

Testing

  1. Copy .env.example to .env and fill in your database credentials.
  2. Run composer test.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • SQLSTATE[42000]: Syntax error or access violation: 1064

    SQLSTATE[42000]: Syntax error or access violation: 1064

    Hi all, I am trying to do an example of tagging. I have appended my model with the HasTags trait and when I do

            $id = Questions::create([
                'body' => request('title'),
                'skillset_id' => request('skillsetId'),
                'tags' => ['red', 'blue']
            ])->id;
    

    I get:

    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>'$."en"' = ? and `type` is null limit 1' at line 1 (SQL: select * from `tags` where `name`->'$."en"' = red and `type` is null limit 1)

    I am on

    • Windows 10
    • MariaDB 10.3.2
    • MySQL 5.7.19

    I have successfully installed and added the migration tables, but the creating of tags is where I fail.

    opened by naknode 22
  • Selecting items tagged with tagsWithType

    Selecting items tagged with tagsWithType

    $tag = Tag::findOrCreate('gossip', 'newsTag');
    $tag2 = Tag::findOrCreate('headline', 'newsTag');
    NewsItem::withAnyTags([$tag, $tag2])->get();
    

    the above code return NewsItem empty

    opened by creative-git 15
  • Option to disable translations

    Option to disable translations

    Hi! Thank you for creating such a great package.

    I (and many others as I imagine) would like to have the option to disable using translations. Please vote if you need this functionality.

    opened by Reex11 10
  • Added support for strings and corresponding tests

    Added support for strings and corresponding tests

    Scopes withAllTags and withAnyTags used to work with strings, it was just an issue with function argument typing. Added test cases.

    At the same time I found out that attribute mutator setTagsAttribute was already accepting a tag as string and passing the argument to syncTags which, however, didn't support that. Fixed the test case of adding a single tag by mutator by removing the array brackets and making it fail, then solved by array wrapping the parameter.

    opened by zupolgec 8
  • add ability to find models with tags of any type

    add ability to find models with tags of any type

    This adds two new scopes:

    scopeWithAllTagsOfAnyType
    scopeWithAnyTagsOfAnyType
    

    and to be clean about it, I added one method to HasTags trait and another to the Tag model to convert given arguments to tags of any type and find tags of any type from strings:

    HasTags::convertToTagsOfAnyType
    Tag::findFromStringOfAnyType
    

    I also added .idea folder to gitignore :)

    opened by mokhosh 8
  • enable support for not MySQL DB engines

    enable support for not MySQL DB engines

    the JSON where syntax works just in MySQL - with this fix it's possible to use this package also with other engines like SQLite. If you won't merge this pls let me know - atm I fixed it by overriding the default model and trait.

    opened by Gummibeer 8
  • Adding tags as part of model creation not working

    Adding tags as part of model creation not working

    I just started using this package so I having been fiddeling with it that much but the first method I used didn't work.

    //create a model with some tags
    $newsItem = Group::find(id)->stories()->create([
       'name' => 'testModel',
       'tags' => ['tag', 'tag2'],
    ]);
    

    this creates the model correctly but does not attach the tags correctly. Am I missing something ?

    opened by minedun6 7
  • Duplicated tags

    Duplicated tags

    Hi there, every time I save a Model with tags, tags are duplicated in the tags table. I'm using $page->syncTags(array_map('trim',explode(',',$request->tags))); Where $request->tags is a comma separated list of tags.

    If I use $page->attachTags(array_map('trim',explode(',',$request->tags))); Tags are duplicated as well and, even worst, multiple idenatical tags are attached to the page.

    In the Page Model definition I have added public function getTagsAttribute() { return implode(',',$this->tags()->pluck('name')->toArray()); } To create the comma separated list to show in the input form.

    This is the (sqlite)DB: 30|{"en":"due tag"}|{"en":"due-tag"}||30|2018-01-17 22:21:44|2018-01-17 22:21:44 31|{"en":"Un tag"}|{"en":"un-tag"}||31|2018-01-17 22:23:02|2018-01-17 22:23:02 32|{"en":"due tag"}|{"en":"due-tag"}||32|2018-01-17 22:23:02|2018-01-17 22:23:02 33|{"en":"Un tag"}|{"en":"un-tag"}||33|2018-01-17 22:23:16|2018-01-17 22:23:16 34|{"en":"due tag"}|{"en":"due-tag"}||34|2018-01-17 22:23:16|2018-01-17 22:23:16 ` As you see the slug is the same several times.

    Any idea of how I could solve this issue? Thank you! ...and compliments!

    opened by gborgonovo 7
  • Scopes only working when I pass it `tag` instance

    Scopes only working when I pass it `tag` instance

    withAnyTags and withAllTags scopes only work when I pass them tag instances, and don't work when I pass them strings.

    I have a tag called 'unreliable' which is attached to two Users. but this returns an empty collection:

    User::withAnyTags('unreliable')->get();
    User::withAnyTags(['unreliable'])->get();
    
    opened by mokhosh 6
  • Adding a static function for current locale to the tag

    Adding a static function for current locale to the tag

    The current locale is not get by app()->getLocale() but by a static function. With this change it is possible to implement custom logic of getting the locale inside of custom Tag. It can also be used to set the locale to a fixed value to "deactivate" the translation functionality.

    opened by leonidlezner 5
  • How to enforce consistency with multi-language tags

    How to enforce consistency with multi-language tags

    We currently rely on the package for toggling some features on-of for certain models. This works great. But we're moving to multi-lingual now, causing the issue that tags are only defined in 1 locale. Would love to create a PR to improve the package here, but I'm wondering what the right approach might be.

    • We could add a key column to the table. Passing a key by creating (or getting it from the name passed as default), and be able to use this key for methods like withAllTags or withAnyTags would solve the issue.

    • We could make the locale getter configurable in the package. By doing this we could enforce one locale being used as a key for example.

    • Other ideas?

    opened by Robertbaelde 5
  • Get tags in use and then order by name

    Get tags in use and then order by name

    Sounds straight forward using

    $tagIds = DB::table('taggables')
                ->distinct()
                ->select('tag_id')
                ->where('taggable_type', 'App\Models\Video')
                ->orderBy('tag_id', 'asc')
                ->get()->unique()->pluck('tag_id');
    
    $tags = \App\Models\Tag::whereIn('id', $tagIds)->orderBy('name', 'asc')->get();
    

    but then I noticed a bunch of tags beginning with A in the middle of the collection.

    Upon inspecting the database, I spotted that new tags seem to be saving as {"en":"Sarah","es":"Sarah"} in the name column whereas tags we've added in the past have been saved as {"en": "Trust"} (note the space after the colon messing with the orderBy).

    Not sure if this is intentional or a bug? Not even sure if this is happening here or in the nova-tags-field package.

    opened by 1stevengrant 0
  • withAnyTags doesn't filter results when using variable

    withAnyTags doesn't filter results when using variable

    I'm using PHP 8.1, Laravel 9 and the latest version of this package. I have a fairly complex model called Domain and must paginate my results. A user has the ability to also search and sort by other options.

    My $search variable is a string (provided by an input field in my front-end), and then I'm attempting to add the withAnyTags method, I do have tags, one called "client" which when I hard-code into the method, and reload my page it does work, but parsing like this is giving me no results.

    What am I missing?

    $domains = Domain::query();
    
    if ($search != '') {
        $domains = $domains->withAnyTags((array) $search);
    }
    
    $domains = $domains->where('domains.user_id', Auth::id())
                        ->where(function ($sql) use ($search) {
                            $sql->orWhere('domains.domain', 'like', "$search%")
                              ->orWhere('domains.status', 'like', "$search%")
                              ->orWhere('domains.registrar', 'like', "$search%");
                        })
                        ->leftJoin('certificates', 'domains.id', '=', 'certificates.domain_id')
                        ->leftJoin('dns', 'domains.id', '=', 'dns.domain_id')
                        ->leftJoin('blacklists', 'domains.id', '=', 'blacklists.domain_id')
                        ->select('domains.*')
                        ->orderBy($sort[0] ?? 'domains.expires_on', $sort[1] ?? 'desc')
                        ->paginate((int) $perPage);
    
    opened by sts-ryan-holton 1
Releases(4.3.5)
  • 4.3.5(Nov 19, 2022)

    What's Changed

    • Add without tags scope by @stfndamjanovic in https://github.com/spatie/laravel-tags/pull/428

    New Contributors

    • @stfndamjanovic made their first contribution in https://github.com/spatie/laravel-tags/pull/428

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.3.4...4.3.5

    Source code(tar.gz)
    Source code(zip)
  • 4.3.4(Nov 17, 2022)

    What's Changed

    • change phpunit to pest testing framework by @uthadehikaru in https://github.com/spatie/laravel-tags/pull/423
    • Fix typos in the docs by @ahmad-moussawi in https://github.com/spatie/laravel-tags/pull/425
    • Fixed Collection support in syncTags function and added regression test by @zupolgec in https://github.com/spatie/laravel-tags/pull/427

    New Contributors

    • @uthadehikaru made their first contribution in https://github.com/spatie/laravel-tags/pull/423
    • @ahmad-moussawi made their first contribution in https://github.com/spatie/laravel-tags/pull/425

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.3.3...4.3.4

    Source code(tar.gz)
    Source code(zip)
  • 4.3.3(Oct 21, 2022)

    What's Changed

    • Added support for strings and corresponding tests by @zupolgec in https://github.com/spatie/laravel-tags/pull/395

    New Contributors

    • @zupolgec made their first contribution in https://github.com/spatie/laravel-tags/pull/395

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.3.2...4.3.3

    Source code(tar.gz)
    Source code(zip)
  • 4.3.2(Jun 4, 2022)

    What's Changed

    • Added example of getting all the tags of a model by @titonova in https://github.com/spatie/laravel-tags/pull/394
    • Update using-tags.md typo by changing "Find" to "find" by @jorgemurta in https://github.com/spatie/laravel-tags/pull/401
    • readme: add example apply trait by @erlangparasu in https://github.com/spatie/laravel-tags/pull/403
    • Update .gitattributes to decrease package installed size by @lakuapik in https://github.com/spatie/laravel-tags/pull/407

    New Contributors

    • @titonova made their first contribution in https://github.com/spatie/laravel-tags/pull/394
    • @jorgemurta made their first contribution in https://github.com/spatie/laravel-tags/pull/401
    • @erlangparasu made their first contribution in https://github.com/spatie/laravel-tags/pull/403
    • @lakuapik made their first contribution in https://github.com/spatie/laravel-tags/pull/407

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.3.1...4.3.2

    Source code(tar.gz)
    Source code(zip)
  • 4.3.1(Mar 8, 2022)

    What's Changed

    • Fix BadMethodCallException caused by attach() by @umairparacha00 in https://github.com/spatie/laravel-tags/pull/389
    • Ignore the phpunit.xml file by default by @markwalet in https://github.com/spatie/laravel-tags/pull/362
    • Fixed the docs by @umairparacha00 in https://github.com/spatie/laravel-tags/pull/390
    • Add support for spatie/laravel-translatable:^6.0 by @dsturm in https://github.com/spatie/laravel-tags/pull/391

    New Contributors

    • @umairparacha00 made their first contribution in https://github.com/spatie/laravel-tags/pull/389
    • @markwalet made their first contribution in https://github.com/spatie/laravel-tags/pull/362
    • @dsturm made their first contribution in https://github.com/spatie/laravel-tags/pull/391

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.3.0...4.3.1

    Source code(tar.gz)
    Source code(zip)
  • 4.3.0(Jan 14, 2022)

  • 4.2.1(Nov 24, 2021)

    What's Changed

    • enable and fix test by @delta1186 in https://github.com/spatie/laravel-tags/pull/373
    • Fix find from string of any type by @delta1186 in https://github.com/spatie/laravel-tags/pull/375

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.2.0...4.2.1

    Source code(tar.gz)
    Source code(zip)
  • 4.2.0(Nov 22, 2021)

    What's Changed

    • Make convertToTags() method $values arg support Tag instance by @chuoke in https://github.com/spatie/laravel-tags/pull/371

    New Contributors

    • @chuoke made their first contribution in https://github.com/spatie/laravel-tags/pull/371

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.1.0...4.2.0

    Source code(tar.gz)
    Source code(zip)
  • 4.1.0(Nov 17, 2021)

    What's Changed

    • Adding a static function for current locale to the tag by @leonidlezner in https://github.com/spatie/laravel-tags/pull/368

    New Contributors

    • @leonidlezner made their first contribution in https://github.com/spatie/laravel-tags/pull/368

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.0.5...4.1.0

    Source code(tar.gz)
    Source code(zip)
  • 4.0.5(Nov 10, 2021)

    What's Changed

    • PHP 8.1 Support by @sergiy-petrov in https://github.com/spatie/laravel-tags/pull/361
    • Update installation-and-setup.md by @PatrickJunod in https://github.com/spatie/laravel-tags/pull/365
    • Remove extra ordered on getWithType by @delta1186 in https://github.com/spatie/laravel-tags/pull/367

    New Contributors

    • @sergiy-petrov made their first contribution in https://github.com/spatie/laravel-tags/pull/361
    • @PatrickJunod made their first contribution in https://github.com/spatie/laravel-tags/pull/365
    • @delta1186 made their first contribution in https://github.com/spatie/laravel-tags/pull/367

    Full Changelog: https://github.com/spatie/laravel-tags/compare/4.0.4...4.0.5

    Source code(tar.gz)
    Source code(zip)
  • 4.0.4(Sep 1, 2021)

  • 4.0.3(Apr 28, 2021)

  • 4.0.2(Apr 7, 2021)

  • 4.0.1(Mar 12, 2021)

  • 4.0.0(Mar 9, 2021)

  • 3.1.0(Mar 1, 2021)

  • 3.0.2(Dec 29, 2020)

  • 3.0.1(Nov 5, 2020)

  • 3.0.0(Sep 9, 2020)

  • 2.7.2(Sep 8, 2020)

  • 2.7.1(Aug 25, 2020)

  • 2.7.0(Aug 22, 2020)

  • 2.6.2(May 28, 2020)

  • 2.6.1(Mar 4, 2020)

  • 2.6.0(Mar 3, 2020)

  • 2.5.4(Feb 12, 2020)

  • 2.5.3(Nov 7, 2019)

  • 2.5.2(Oct 29, 2019)

  • 2.5.1(Sep 8, 2019)

Owner
Spatie
Webdesign agency based in Antwerp, Belgium
Spatie
Sortable behaviour for Eloquent models

Sortable behaviour for Eloquent models This package provides a trait that adds sortable behaviour to an Eloquent model. The value of the order column

Spatie 1.2k Dec 22, 2022
Laravel SEO - This is a simple and extensible package for improving SEO via meta tags, such as OpenGraph tags.

This is a simple and extensible package for improving SEO via meta tags, such as OpenGraph tags.

ARCHTECH 191 Dec 30, 2022
Laravel Breadcrumbs - An easy way to add breadcrumbs to your @Laravel app.

Introduction Breadcrumbs display a list of links indicating the position of the current page in the whole site hierarchy. For example, breadcrumbs lik

Alexandr Chernyaev 269 Dec 21, 2022
This is a plugin written in the PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform. It helps to liven up your server with Tags!

General This is a plugin written in the PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform.

Thành Nhân 4 Oct 21, 2021
Add Webhooks to your Laravel app, arrr

# Captain Hook ## Add Webhooks to your Laravel app, arrr Implement multiple webhooks into your Laravel app using the Laravel Event system. A webhook i

Marcel Pociot 334 Dec 12, 2022
A Laravel 8 and Livewire 2 demo showing how to search and filter by tags, showing article and video counts for each tag (Polymorphic relationship)

Advanced search and filter with Laravel and Livewire A demo app using Laravel 8 and Livewire 2 showing how to implement a list of articles and tags, v

Sérgio Jardim 19 Aug 29, 2022
Laravel Nova filter for Spatie/laravel-tags

SpatieTagsNovaFilter This package allows you to filter resources by tags. (using the awesome Spatie/laravel-tags and Vue-MultiSelect ) Installation Fi

Mahi-Mahi 3 Aug 4, 2022
HTML Meta Tags management package available for for Laravel 5.*

HTML Meta Tags management package available for Laravel 5/6/7/8 With this package you can manage header Meta Tags from Laravel controllers. If you wan

Lito 182 Dec 5, 2022
Forked from spatie-laravel-tags

Add tags and taggable behaviour to a Laravel app This package offers taggable behaviour for your models. After the package is installed the only thing

null 1 Nov 15, 2021
Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard

Laravel Seo Tools Laravel is becoming more and more popular and lots of web application are developing. In most of the web application there need some

Tuhin Bepari 130 Dec 23, 2022
Simple laravel hook for adding meta tags to head for inertia

laravel seo hook for js frameworks simple hook for adding meta tags to <head></head> for js frameworks inertia:react,vue, etc... in app/Meta.php put M

Razmik Ayvazyan 2 Aug 23, 2022
Add variables to the payload of all jobs in a Laravel app

Inject extra info to the payloads of all jobs in a Laravel app This package makes it easy to inject things in every job. Imagine that you want to have

Spatie 62 Dec 9, 2022
Tags im Museum ist ein Projekt aus dem Hackaton cdv-ost.

Tags-im-Museum Tags im Museum ist ein Projekt aus dem Hackaton cdv-ost. Vom Naturkundemuseum Leipzig wurden Tagebücher der Museumsdirektoren aus den J

Steve Krämer 1 Apr 26, 2022
Easily add all the 58 Algerian Wilayas and its Dairas to your cool Laravel project (Migrations, Seeders and Models).

Laravel-Algereography Laravel-Algereography allows you to add Migrations, Seeders and Models of Algerian Wilayas and Dairas to your existing or new co

Hocine Saad 48 Nov 25, 2022
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

WebDevEtc. 227 Dec 25, 2022
A simple blog app where a user can signup , login, like a post , delete a post , edit a post. The app is built using laravel , tailwind css and postgres

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Nahom_zd 1 Mar 6, 2022
Laravel-tagmanager - An easier way to add Google Tag Manager to your Laravel application.

Laravel TagManager An easier way to add Google Tag Manager to your Laravel application. Including recommended GTM events support. Requirements Laravel

Label84 16 Nov 23, 2022
Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.

OvalFi Laravel Package Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App. Installation You can in

Paul Adams 2 Sep 8, 2022
Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.

Laravel Blade Sortable Demo Repo Installation You can install the package via composer: composer require asantibanez/laravel-blade-sortable After the

Andrés Santibáñez 370 Dec 23, 2022