imports()->delete(); $group->exports()->delete(); }); } public function exports() { return $this->hasMany(Export::class); } public function imports() { return $this->hasMany(Import::class); } public function getFilenameAttribute() { $locale = app()->getLocale(); return now()->format('Y-m-d') . "-{$locale}-{$this->type}-{$this->hashid}.xlsx"; } public function getHashidAttribute() { return Hashids::encode($this->id); } }