Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected static function boot()
- {
- parent::boot();
- static::saved(function(Discount $discount) {
- $condition_name = "";
- foreach ($discount->conditions as $condition) {
- $condition_name .= $condition["name"]. ' ';
- }
- $dispatcher = static::$dispatcher;
- static::unsetEventDispatcher();
- $discount->update(['condition' => trim($condition_name)]);
- static::setEventDispatcher($dispatcher);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement