Skip to content

Commit

Permalink
ObservedBy class attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Feb 13, 2024
1 parent 40c2d9b commit 4edad9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/Models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TypiCMS\Modules\Events\Models;

use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
Expand All @@ -10,10 +11,12 @@
use Spatie\Translatable\HasTranslations;
use TypiCMS\Modules\Core\Models\Base;
use TypiCMS\Modules\Core\Models\File;
use TypiCMS\Modules\Core\Observers\SlugObserver;
use TypiCMS\Modules\Core\Traits\HasFiles;
use TypiCMS\Modules\Core\Traits\Historable;
use TypiCMS\Modules\Events\Presenters\ModulePresenter;

#[ObservedBy(SlugObserver::class)]
class Event extends Base
{
use HasFiles;
Expand Down
4 changes: 0 additions & 4 deletions src/Providers/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use TypiCMS\Modules\Core\Facades\TypiCMS;
use TypiCMS\Modules\Core\Observers\SlugObserver;
use TypiCMS\Modules\Events\Composers\SidebarViewComposer;
use TypiCMS\Modules\Events\Facades\Events;
use TypiCMS\Modules\Events\Models\Event;
Expand All @@ -28,9 +27,6 @@ public function boot(): void

AliasLoader::getInstance()->alias('Events', Events::class);

// Observers
Event::observe(new SlugObserver());

View::composer('core::admin._sidebar', SidebarViewComposer::class);

/*
Expand Down

0 comments on commit 4edad9e

Please sign in to comment.