Move model observers onto attributes and tidy provider bindings.
Register observers with ObservedBy, bind the comment spam classifier, and keep AppServiceProvider focused on application wiring.
This commit is contained in:
@@ -2,15 +2,16 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Observers\ContentTypeObserver;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
|
||||
use App\Models\Artwork;
|
||||
|
||||
#[ObservedBy([ContentTypeObserver::class])]
|
||||
class ContentType extends Model
|
||||
{
|
||||
protected $fillable = ['name','slug','description','order','hide_from_menu','mascot_path','cover_art_path'];
|
||||
protected $fillable = ['name', 'slug', 'description', 'order', 'hide_from_menu', 'mascot_path', 'cover_art_path'];
|
||||
|
||||
protected $casts = [
|
||||
'order' => 'integer',
|
||||
@@ -81,6 +82,6 @@ class ContentType extends Model
|
||||
return $path;
|
||||
}
|
||||
|
||||
return rtrim((string) config('cdn.files_url', 'https://cdn.skinbase.org'), '/') . '/' . ltrim($path, '/');
|
||||
return rtrim((string) config('cdn.files_url', 'https://cdn.skinbase.org'), '/').'/'.ltrim($path, '/');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user