Fire Laravel events on touch

Fire Laravel events on touch

this is my scenario: I'm using Laravel 5.5.x. I have two models, linked in one to many way.

this is my scenario: I'm using Laravel 5.5.x. I have two models, linked in one to many way.

class Artwork extends Model
{
   //It has timestamps
   protected $table = 'artworks';
   protected $fillable = [
        'artwork_category_id'
   ];
   public function artworkCategory()
    {
        return $this->belongsTo('App\Models\ArtworkCategory');
    }
}

class ArtworkCategory extends Model { use SoftDeletes;

protected $touches = ["artworks"];

/**
 * @var string
 */
protected $table = 'artwork_categories';
 protected $fillable = [
    'category_name',
    'acronym',
    'deleted_at'
];

public function artworks()
{
    return $this->hasMany('App\Models\Artwork');
}

}

Touch works correctly, so when I update an artwork category the related artworks updated_at field is updated.

But I need to listen the "touch" event on each artwork. I've tried inserting "updated" listener on boot method in AppServiceProvider, but it is not fired.

Artwork::updated(function ($model){
            \Log::debug("HERE I AM");
        });

I've tried using an observer, but no luck.

class ArtworkObserver
{
    public function updated(Artwork $artwork)
    {
        dd($artwork);
    }
}

Boot method in AppServiceProvider:

Artwork::observe(ArtworkObserver::class)

Question: Could somebody show me the right way to do it? Or tell me where am I wrong? I was not good enough to find an example that helps me how to do it.

Update I need to achieve this because I have to "fire" Scout to save updated data on Elasticsearch on Artwork index.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Clear Cache in Laravel 6.8 App using Artisan Command Interface (CLI)

In Laravel 6 tutorial, we learn how to use PHP artisan command interface (CLI) to clear the cache from Laravel 6.8 application. How To Clear Cache in Laravel 6.8 Application using Artisan Command Line Interface (CLI)? How to clear route cache using php artisan command? How to easily clear cache in Laravel application? How to clear config cache in PHP Laravel via artisan command? How to clear Laravel view cache? How to Reoptimized class in Laravel via artisan CLI?

Get Weather Data with Laravel Weather

Get Weather Data with Laravel Weather. Laravel Weather is a good package which we can use to get weather data. It's a wrapper around Open Weather Map API (Current weather). A wrapper around Open Weather Map API (Current weather)

Laravel Sweet Alert | How to use the SweetAlert package in Laravel PHP

Sweet Alert is a laravel wrapper around #sweetalert javascript library for showing alert or notification message. This is a great package created by rashid, and this laravel package is very famous because it has tonnes of features you can choose from.