SmsSender = $SmsSender; $this->helpers = $helpers; } public function index(){ $otps = SmsSender::where('status', false)->get(); $answer = []; foreach ($otps as $item) { $answer[] = ["phone_number" => (string)$item->phone, "body" => (string) $item->message]; $item->status = true; $item->save(); } $data = [ "error"=> null, "message"=> "OK", "status" => 200, "category"=> null, "data" => $answer ]; return response()->json($data, 200); } public static function getAfterFilters() {return [];} public static function getBeforeFilters() {return [];} public static function getMiddleware() {return [];} public function callAction($method, $parameters=false) { return call_user_func_array(array($this, $method), $parameters); } }