| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle() |
||
| 42 | { |
||
| 43 | $subscriptions = Subscription::where('status','=',\constSubscription::Expired)->where('end_date','=',Carbon::today()->subDay())->get(); |
||
| 44 | |||
| 45 | $sms_trigger = Sms_trigger::where('alias','=','subscription_expired')->first(); |
||
| 46 | $message = $sms_trigger->message; |
||
| 47 | $sms_status = $sms_trigger->status; |
||
| 48 | $sender_id = \Utilities::getSetting('sms_sender_id'); |
||
| 49 | |||
| 50 | foreach ($subscriptions as $subscription) |
||
| 51 | { |
||
| 52 | $sms_text = sprintf($message,$subscription->member->name,$subscription->end_date->format('d-m-Y')); |
||
| 53 | \Utilities::Sms($sender_id,$subscription->member->contact,$sms_text,$sms_status); |
||
| 54 | } |
||
| 57 |