芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/pennysave/application/app/Notify/Notify.php
sendVia = $sendVia; $this->setting = GeneralSetting::first(); } /** * Send notification via methods. * * This method is creating instances of notifications to send the notification. * * @return void */ public function send(){ $methods = []; //get the notification method classes which are selected if($this->sendVia){ foreach ($this->sendVia as $sendVia) { $methods[$sendVia] = $this->notifyMethods($sendVia); } }else{ $methods = $this->notifyMethods(); } //send the notification via methods one by one foreach($methods as $method){ $notify = new $method; $notify->templateName = $this->templateName; $notify->shortCodes = $this->shortCodes; $notify->user = $this->user; $notify->setting = $this->setting; $notify->createLog = $this->createLog; $notify->userColumn = $this->userColumn; $notify->send(); } } /** * Get the notification method classes. * * @param array|null $sendVia * @return array|string */ protected function notifyMethods($sendVia = null){ $methods = [ 'email'=>Email::class, 'sms'=>Sms::class ]; if ($sendVia) { return $methods[$sendVia]; } return $methods; } }