feat(Service & Membership): checkbox and sync
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user