*/ protected $fillable = [ 'name' ]; /** * The "booted" method of the model. * * @return void */ protected static function boot(): void { parent::boot(); static::deleting(function (self $model) { $model->users()->detach(); }); } // * RELATIONSHIPS /** * Get the urls for the brand. * * @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Url, $this> */ public function urls() { return $this->hasMany(Url::class); } /** * Get the urls for the brand. * * @return \Illuminate\Database\Eloquent\Relations\HasMany<\App\Models\Service, $this> */ public function services() { return $this->hasMany(Service::class); } /** * The users that belong to the brand. * * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany<\App\Models\User, * $this, * \Illuminate\Database\Eloquent\Relations\Pivot> */ public function users(): BelongsToMany { return $this->belongsToMany(User::class); } }