| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle() |
||
| 42 | { |
||
| 43 | $birthdays = Member::whereMonth('DOB','=',Carbon::today()->month)->whereDay('DOB','=',Carbon::today()->day)->where('status','=',\constStatus::Active)->get(); |
||
| 44 | $sender_id = \Utilities::getSetting('sms_sender_id'); |
||
| 45 | $gym_name = \Utilities::getSetting('gym_name'); |
||
| 46 | |||
| 47 | $sms_trigger = Sms_trigger::where('alias','=','member_birthday')->first(); |
||
| 48 | $message = $sms_trigger->message; |
||
| 49 | $sms_status = $sms_trigger->status; |
||
| 50 | |||
| 51 | foreach($birthdays as $birthday) |
||
| 52 | { |
||
| 53 | $sms_text = sprintf($message,$birthday->name,$gym_name); |
||
| 54 | \Utilities::Sms($sender_id,$birthday->contact,$sms_text,$sms_status); |
||
| 55 | } |
||
| 58 |