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 c273292 commit 7280f57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/Models/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

namespace TypiCMS\Modules\Places\Models;

use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Laracasts\Presenter\PresentableTrait;
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\Places\Presenters\ModulePresenter;

#[ObservedBy(SlugObserver::class)]
class Place 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\Places\Composers\SidebarViewComposer;
use TypiCMS\Modules\Places\Facades\Places;
use TypiCMS\Modules\Places\Models\Place;
Expand All @@ -28,9 +27,6 @@ public function boot(): void

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

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

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

/*
Expand Down

0 comments on commit 7280f57

Please sign in to comment.