first(); $check_ip = isset($q_check_ip)?$q_check_ip->ip:'0'; if($check_ip != $ip){ $visitors = \App\Visitors::where('created_at',Carbon::now())->where('ip',$ip)->first(); (empty($visitors)) ? $visitors = new \App\Visitors : ''; $visitors->ip = $ip; $visitors->web = $visitors->web+1; $visitors->save(); } } } public static function sendSMS($to,$message) { } public static function loyalty_points_log($customer_id,$customer_name,$transaction,$type,$points) { if($customer_id && $customer_name && $transaction && $type && $points){ $lpl = new \App\LoyaltyPointsLogs; $lpl->customer_id = $customer_id; $lpl->customer_name = $customer_name; $lpl->transaction = $transaction; $lpl->type = $type; $lpl->points = $points; $lpl->save(); } } public static function notification($type,$body) { $create = new \App\Notification; $create->type = $type; $create->body = $body; $create->new = 0; $create->save(); } }