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 3a2d543 commit 779f032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/Models/Partner.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace TypiCMS\Modules\Partners\Models;

use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laracasts\Presenter\PresentableTrait;
Expand All @@ -10,9 +11,11 @@
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\Historable;
use TypiCMS\Modules\Partners\Presenters\ModulePresenter;

#[ObservedBy(SlugObserver::class)]
class Partner extends Base implements Sortable
{
use HasTranslations;
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\Partners\Composers\SidebarViewComposer;
use TypiCMS\Modules\Partners\Facades\Partners;
use TypiCMS\Modules\Partners\Models\Partner;
Expand All @@ -27,9 +26,6 @@ public function boot(): void

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

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

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

/*
Expand Down

0 comments on commit 779f032

Please sign in to comment.