feat(Service & Membership): checkbox and sync

This commit is contained in:
2025-10-23 12:35:26 +02:00
parent 07160656f5
commit 052e38730c
4 changed files with 33 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Service extends Model
{
@@ -18,4 +19,9 @@ class Service extends Model
{
return __('services.fields.' . $attribute);
}
public function memberships() : BelongsToMany
{
return $this->belongsToMany(Membership::class, 'services_memberships', 'service_id', 'membership_id');
}
}