Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * PACKAGE CONTROLLER
- * code attach
- */
- $weddingPackage->weddingServices()->attach(
- $request->services,
- [
- 'qty' => $request->qty,
- 'total' => $request->hargaService
- ]
- );
- /**
- * Model Package
- */
- public function weddingServices()
- {
- return $this->belongsToMany(WeddingService::class, 'wed_pack_serv', 'wed_pack_id', 'wed_serv_id')->withPivot(['qty', 'total']);
- }
- /**
- * Model service
- */
- public function weddingPackages()
- {
- return $this->belongsToMany(WeddingPackage::class, 'wed_pack_serv', 'wed_pack_id', 'wed_serv_id')->withPivot(['qty', 'total']);
- }
Add Comment
Please, Sign In to add comment