Created
January 28, 2017 22:56
-
-
Save insign/af745e5aea3cf02ed6dacc4eca1b171b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function createProduct() | |
{ | |
return Product::create($this->request->all()); | |
} | |
protected function applyDiscount($type, $product) | |
{ | |
$discount = Discount::byType($type); | |
$discount->applyDiscountForProduct($product); | |
} | |
protected function notifyUsersVia($method) | |
{ | |
$users = User::all(); | |
foreach ($users as $user) { | |
$notification = Notification::via($method); | |
$notification->notifyUser($user); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment