Subiendo proyecto completo sin restricciones de git ignore

This commit is contained in:
Jose Sanchez
2023-08-17 11:44:02 -04:00
parent a0d4f5ba3b
commit 20f1c60600
19921 changed files with 2509159 additions and 45 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

View File

@@ -0,0 +1,112 @@
{
"name": "OTP",
"unique_identifier": "otp_system",
"version": "2.3",
"minimum_item_version": "7.5.0",
"addon_banner": "otp_system.png",
"directory": [
{
"name": [
"resources/views/otp_systems",
"resources/views/backend/otp_systems",
"resources/views/backend/otp_systems/configurations",
"resources/views/backend/otp_systems/configurations/partials",
"resources/views/backend/otp_systems/sms",
"resources/views/otp_systems/frontend",
"resources/views/otp_systems/frontend/auth",
"resources/views/otp_systems/frontend/auth/passwords"
]
}
],
"sql_file": "",
"files": [
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/index.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/index.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/activation.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/activation.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/sms_templates.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/sms_templates.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/twillo.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/twillo.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/nexmo.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/nexmo.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/fast2sms.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/fast2sms.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/mimo.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/mimo.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/mimsms.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/mimsms.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/msegat.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/msegat.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/sparrow.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/sparrow.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/ssl_wireless.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/ssl_wireless.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/configurations/partials/zender.blade.php",
"update_directory": "resources/views/backend/otp_systems/configurations/partials/zender.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/sms/index.blade.php",
"update_directory": "resources/views/backend/otp_systems/sms/index.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/frontend/auth/passwords/reset_with_phone.blade.php",
"update_directory": "resources/views/otp_systems/frontend/auth/passwords/reset_with_phone.blade.php"
},
{
"root_directory": "addons/otp_system/views/otp_systems/frontend/user_verification.blade.php",
"update_directory": "resources/views/otp_systems/frontend/user_verification.blade.php"
},
{
"root_directory": "addons/otp_system/controllers/OTPController.php",
"update_directory": "app/Http/Controllers/OTPController.php"
},
{
"root_directory": "addons/otp_system/controllers/SmsController.php",
"update_directory": "app/Http/Controllers/SmsController.php"
},
{
"root_directory": "addons/otp_system/controllers/OTPVerificationController.php",
"update_directory": "app/Http/Controllers/OTPVerificationController.php"
},
{
"root_directory": "addons/otp_system/controllers/SmsTemplateController.php",
"update_directory": "app/Http/Controllers/SmsTemplateController.php"
},
{
"root_directory": "addons/otp_system/utility/MimoUtility.php",
"update_directory": "app/Utility/MimoUtility.php"
},
{
"root_directory": "addons/otp_system/utility/SmsUtility.php",
"update_directory": "app/Utility/SmsUtility.php"
},
{
"root_directory": "addons/otp_system/assets/otp_system.png",
"update_directory": "public/otp_system.png"
}
]
}

View File

@@ -0,0 +1,94 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\OtpConfiguration;
class OTPController extends Controller
{
public function __construct() {
// Staff Permission Check
$this->middleware(['permission:otp_configurations'])->only('configure_index');
$this->middleware(['permission:sms_providers_configurations'])->only('credentials_index');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function configure_index()
{
$otp_configurations = OtpConfiguration::all();
return view('backend.otp_systems.configurations.activation', compact('otp_configurations'));
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function credentials_index()
{
$otp_configurations = OtpConfiguration::all();
return view('backend.otp_systems.configurations.index', compact('otp_configurations'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function updateActivationSettings(Request $request)
{
$business_settings = OtpConfiguration::where('type', $request->type)->first();
if($business_settings!=null){
$business_settings->value = $request->value;
$business_settings->save();
}
else{
$business_settings = new OtpConfiguration;
$business_settings->type = $request->type;
$business_settings->value = $request->value;
$business_settings->save();
}
return '1';
}
/**
* Update the specified resource in .env
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function update_credentials(Request $request)
{
foreach ($request->types as $key => $type) {
$this->overWriteEnvFile($type, $request[$type]);
}
flash("Settings updated successfully")->success();
return back();
}
/**
*.env file overwrite
*/
public function overWriteEnvFile($type, $val)
{
$path = base_path('.env');
if (file_exists($path)) {
$val = '"'.trim($val).'"';
if(is_numeric(strpos(file_get_contents($path), $type)) && strpos(file_get_contents($path), $type) >= 0){
file_put_contents($path, str_replace(
$type.'="'.env($type).'"', $type.'='.$val, file_get_contents($path)
));
}
else{
file_put_contents($path, file_get_contents($path)."\r\n".$type.'='.$val);
}
}
}
}

View File

@@ -0,0 +1,143 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Auth\Events\PasswordReset;
use Auth;
use App\Models\User;
use App\Utility\SmsUtility;
use Hash;
class OTPVerificationController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function verification(Request $request){
if (Auth::check() && Auth::user()->email_verified_at == null) {
return view('otp_systems.frontend.user_verification');
}
else {
flash('You have already verified your number')->warning();
return redirect()->route('home');
}
}
/**
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function verify_phone(Request $request){
$user = Auth::user();
if ($user->verification_code == $request->verification_code) {
$user->email_verified_at = date('Y-m-d h:m:s');
$user->save();
flash('Your phone number has been verified successfully')->success();
return redirect()->route('home');
}
else{
flash('Invalid Code')->error();
return back();
}
}
/**
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function resend_verificcation_code(Request $request){
$user = Auth::user();
$user->verification_code = rand(100000,999999);
$user->save();
SmsUtility::phone_number_verification($user);
return back();
}
/**
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function reset_password_with_code(Request $request)
{
$phone = "+{$request['country_code']}{$request['phone']}";
if (($user = User::where('phone', $phone)->where('verification_code', $request->code)->first()) != null) {
if ($request->password == $request->password_confirmation) {
$user->password = Hash::make($request->password);
$user->email_verified_at = date('Y-m-d h:m:s');
$user->save();
event(new PasswordReset($user));
auth()->login($user, true);
if (auth()->user()->user_type == 'admin' || auth()->user()->user_type == 'staff') {
flash("Password has been reset successfully")->success();
return redirect()->route('admin.dashboard');
}
flash("Password has been reset successfully")->success();
return redirect()->route('home');
} else {
flash("Password and confirm password didn't match")->warning();
return view('otp_systems.frontend.auth.passwords.reset_with_phone');
}
} else {
flash("Verification code mismatch")->error();
return view('otp_systems.frontend.auth.passwords.reset_with_phone');
}
}
/**
* @param User $user
* @return void
*/
public function send_code($user){
SmsUtility::phone_number_verification($user);
}
/**
* @param Order $order
* @return void
*/
public function send_order_code($order){
$phone = json_decode($order->shipping_address)->phone;
if($phone != null){
SmsUtility::order_placement($phone, $order);
}
}
/**
* @param Order $order
* @return void
*/
public function send_delivery_status($order){
$phone = json_decode($order->shipping_address)->phone;
if($phone != null){
SmsUtility::delivery_status_change($phone, $order);
}
}
/**
* @param Order $order
* @return void
*/
public function send_payment_status($order){
$phone = json_decode($order->shipping_address)->phone;
if($phone != null){
SmsUtility::payment_status_change($phone, $order);
}
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Services\SendSmsService;
use App\Models\User;
class SmsController extends Controller
{
public function __construct() {
// Staff Permission Check
$this->middleware(['permission:send_bulk_sms'])->only('index');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$users = User::all();
return view('backend.otp_systems.sms.index',compact('users'));
}
//send message to multiple users
public function send(Request $request)
{
foreach ($request->user_phones as $key => $phone) {
(new SendSmsService())->sendSMS($phone, env('APP_NAME'), $request->content, $request->template_id);
}
flash(translate('SMS has been sent.'))->success();
return redirect()->route('admin.dashboard');
}
}

View File

@@ -0,0 +1,109 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\SmsTemplate;
class SmsTemplateController extends Controller
{
public function __construct() {
// Staff Permission Check
$this->middleware(['permission:sms_templates'])->only('index');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$sms_templates = SmsTemplate::all();
return view('backend.otp_systems.configurations.sms_templates', compact('sms_templates'));
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$sms_template = SmsTemplate::where('id', $id)->first();
$sms_template->sms_body = str_replace("\r\n",'',$request->body);
$sms_template->template_id = $request->template_id;
if ($request->status == 1) {
$sms_template->status = 1;
}
else{
$sms_template->status = 0;
}
if($sms_template->save()){
flash(translate('SMS Template has been updated successfully'))->success();
return back();
} else {
flash(translate('Sorry! Something went wrong.'))->error();
return back();
}
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}

View File

@@ -0,0 +1,2 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES (NULL, 'ssl_wireless', '0', current_timestamp(), current_timestamp());
COMMIT;

View File

@@ -0,0 +1,2 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES (NULL, 'fast2sms', '0', current_timestamp(), current_timestamp());
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1,2 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES (NULL, 'mimo', '0', current_timestamp(), current_timestamp());
COMMIT;

View File

@@ -0,0 +1,25 @@
CREATE TABLE `sms_templates` (
`id` int(11) NOT NULL,
`identifier` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`sms_body` longtext COLLATE utf8_unicode_ci NOT NULL,
`template_id` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `sms_templates` (`id`, `identifier`, `sms_body`, `template_id`, `status`, `created_at`, `updated_at`) VALUES
(1, 'phone_number_verification', '[[code]] is your verification code for [[site_name]].', NULL, 0, '2021-06-07 13:29:22', '2021-06-08 02:38:18'),
(2, 'password_reset', 'Your password reset code is [[code]].', NULL, 1, '2021-06-07 13:29:34', '2021-06-07 13:29:34'),
(3, 'order_placement', 'Your order has been placed and Order Code is [[order_code]]', NULL, 1, '2021-06-07 13:32:22', '2021-06-08 02:39:25'),
(4, 'delivery_status_change', 'Your delivery status has been updated to [[delivery_status]] for Order code : [[order_code]]', NULL, 1, '2021-06-07 13:33:14', '2021-06-08 02:39:28'),
(5, 'payment_status_change', 'Your payment status has been updated to [[payment_status]] for Order code : [[order_code]]', NULL, 1, '2021-06-07 13:35:23', '2021-06-08 02:39:31'),
(6, 'assign_delivery_boy', 'You are assigned to deliver an order. Order code : [[order_code]]', NULL, 1, '2021-06-07 13:38:10', '2021-06-08 02:39:34');
ALTER TABLE `sms_templates`
ADD PRIMARY KEY (`id`);
ALTER TABLE `sms_templates`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;

View File

@@ -0,0 +1,2 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES (NULL, 'mimsms', '0', current_timestamp(), current_timestamp());
COMMIT;

View File

@@ -0,0 +1,2 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES (NULL, 'msegat', '0', current_timestamp(), current_timestamp());
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1 @@
COMMIT;

View File

@@ -0,0 +1,13 @@
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`)
SELECT NULL, 'sparrow', '0', current_timestamp(), current_timestamp() FROM DUAL
WHERE NOT EXISTS (SELECT * FROM `otp_configurations` WHERE `type`='sparrow' LIMIT 1);
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`)
SELECT NULL, 'zender', '0', current_timestamp(), current_timestamp() FROM DUAL
WHERE NOT EXISTS (SELECT * FROM `otp_configurations` WHERE `type`='zender' LIMIT 1);
DELETE FROM `otp_configurations` WHERE `type` = 'otp_for_order';
DELETE FROM `otp_configurations` WHERE `type` = 'otp_for_delivery_status';
DELETE FROM `otp_configurations` WHERE `type` = 'otp_for_paid_status';
COMMIT;

View File

@@ -0,0 +1,107 @@
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 23, 2020 at 07:35 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*Column will be added on user table*/
ALTER TABLE `users` CHANGE `verification_code` `verification_code` TEXT NULL DEFAULT NULL;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shop`
--
-- --------------------------------------------------------
--
-- Table structure for table `otp_configurations`
--
CREATE TABLE `otp_configurations` (
`id` int(11) NOT NULL,
`type` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `otp_configurations`
--
INSERT INTO `otp_configurations` (`id`, `type`, `value`, `created_at`, `updated_at`) VALUES
(1, 'nexmo', '1', '2020-03-22 09:19:07', '2020-03-22 09:19:07'),
(5, 'twillo', '0', '2020-03-22 09:54:03', '2020-03-22 03:54:20'),
(6, 'ssl_wireless', '0', '2020-03-22 09:54:03', '2020-03-22 03:54:20'),
(7, 'fast2sms', '0', '2020-03-22 09:54:03', '2020-03-22 03:54:20'),
(8, 'mimsms', '0', '2020-03-22 09:54:03', '2020-03-22 03:54:20'),
(9, 'mimo', '0', '2020-12-27 09:54:03', '2020-12-28 03:54:20'),
(10, 'msegat', '0', '2020-12-27 09:54:03', '2020-12-28 03:54:20'),
(11, 'sparrow', '0', '2020-12-27 09:54:03', '2020-12-28 03:54:20'),
(12, 'zender', '0', '2020-12-27 09:54:03', '2020-12-28 03:54:20');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `otp_configurations`
--
ALTER TABLE `otp_configurations`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `otp_configurations`
--
ALTER TABLE `otp_configurations`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
CREATE TABLE `sms_templates` (
`id` int(11) NOT NULL,
`identifier` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`sms_body` longtext COLLATE utf8_unicode_ci NOT NULL,
`template_id` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `sms_templates` (`id`, `identifier`, `sms_body`, `template_id`, `status`, `created_at`, `updated_at`) VALUES
(1, 'phone_number_verification', '[[code]] is your verification code for [[site_name]].', NULL, 0, '2021-06-07 13:29:22', '2021-06-08 02:38:18'),
(2, 'password_reset', 'Your password reset code is [[code]].', NULL, 1, '2021-06-07 13:29:34', '2021-06-07 13:29:34'),
(3, 'order_placement', 'Your order has been placed and Order Code is [[order_code]]', NULL, 1, '2021-06-07 13:32:22', '2021-06-08 02:39:25'),
(4, 'delivery_status_change', 'Your delivery status has been updated to [[delivery_status]] for Order code : [[order_code]]', NULL, 1, '2021-06-07 13:33:14', '2021-06-08 02:39:28'),
(5, 'payment_status_change', 'Your payment status has been updated to [[payment_status]] for Order code : [[order_code]]', NULL, 1, '2021-06-07 13:35:23', '2021-06-08 02:39:31'),
(6, 'assign_delivery_boy', 'You are assigned to deliver an order. Order code : [[order_code]]', NULL, 1, '2021-06-07 13:38:10', '2021-06-08 02:39:34');
ALTER TABLE `sms_templates`
ADD PRIMARY KEY (`id`);
ALTER TABLE `sms_templates`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View File

@@ -0,0 +1,91 @@
<?php
namespace App\Utility;
class MimoUtility
{
public static function getToken()
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '52.30.114.86:8080/mimosms/v1/user/login',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"username": "'.env('MIMO_USERNAME').'",
"password": "'.env('MIMO_PASSWORD').'"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
return json_decode($response)->token;
}
public static function sendMessage($text, $to, $token)
{
$curl = curl_init();
$fields = array(
"sender" => env("MIMO_SENDER_ID"),
"text" => $text,
"recipients" => $to
);
// dd($to);
curl_setopt_array($curl, array(
CURLOPT_URL => '52.30.114.86:8080/mimosms/v1/message/send?token='.$token,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($fields),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
// dd($response);
curl_close($curl);
return 1;
}
public static function logout($token)
{
// dd('Hello world');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '52.30.114.86:8080/mimosms/v1/user/logout?token='.$token,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
// dd($response, $token);
}
}

View File

@@ -0,0 +1,78 @@
<?php
namespace App\Utility;
use App\Models\OtpConfiguration;
use App\Models\SmsTemplate;
use App\Models\User;
use App\Services\SendSmsService;
class SmsUtility
{
public static function phone_number_verification($user = '')
{
$sms_template = SmsTemplate::where('identifier', 'phone_number_verification')->first();
$sms_body = $sms_template->sms_body;
$sms_body = str_replace('[[code]]', $user->verification_code, $sms_body);
$sms_body = str_replace('[[site_name]]', env('APP_NAME'), $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($user->phone, env('APP_NAME'), $sms_body, $template_id);
}
public static function password_reset($user = '')
{
$sms_template = SmsTemplate::where('identifier', 'password_reset')->first();
$sms_body = $sms_template->sms_body;
$sms_body = str_replace('[[code]]', $user->verification_code, $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($user->phone, env('APP_NAME'), $sms_body, $template_id);
}
public static function order_placement($phone = '', $order = '')
{
$sms_template = SmsTemplate::where('identifier', 'order_placement')->first();
$sms_body = $sms_template->sms_body;
$sms_body = str_replace('[[order_code]]', $order->code, $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($phone, env('APP_NAME'), $sms_body, $template_id);
}
public static function delivery_status_change($phone = '', $order)
{
$sms_template = SmsTemplate::where('identifier', 'delivery_status_change')->first();
$sms_body = $sms_template->sms_body;
$delivery_status = translate(ucfirst(str_replace('_', ' ', $order->delivery_status)));
$sms_body = str_replace('[[delivery_status]]', $delivery_status, $sms_body);
$sms_body = str_replace('[[order_code]]', $order->code, $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($phone, env('APP_NAME'), $sms_body, $template_id);
}
public static function payment_status_change($phone = '', $order = '')
{
$sms_template = SmsTemplate::where('identifier', 'payment_status_change')->first();
$sms_body = $sms_template->sms_body;
$sms_body = str_replace('[[payment_status]]', translate(ucfirst($order->payment_status)), $sms_body);
$sms_body = str_replace('[[order_code]]', $order->code, $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($phone, env('APP_NAME'), $sms_body, $template_id);
}
public static function assign_delivery_boy($phone = '', $code = '')
{
$sms_template = SmsTemplate::where('identifier', 'assign_delivery_boy')->first();
$sms_body = $sms_template->sms_body;
$sms_body = str_replace('[[order_code]]', $code, $sms_body);
$template_id = $sms_template->template_id;
(new SendSmsService())->sendSMS($phone, env('APP_NAME'), $sms_body, $template_id);
}
}

View File

@@ -0,0 +1,45 @@
@extends('backend.layouts.app')
@section('content')
<h4 class="text-center text-muted">{{translate('Activate OTP')}}</h4>
<div class="row">
@foreach ($otp_configurations as $otp_configuration)
<div class="col-md-4">
<div class="card">
<div class="card-header">
<h3 class="mb-0 h6">
{{translate(Str::replace('_', ' ',Str::title($otp_configuration->type)).' OTP')}}
</h3>
</div>
<div class="card-body text-center">
<label class="aiz-switch aiz-switch-success mb-0">
<input type="checkbox" onchange='updateSettings(this, "{{ $otp_configuration->type }}")' @if($otp_configuration->value == 1) checked @endif>
<span class="slider round"></span>
</label>
</div>
</div>
</div>
@endforeach
</div>
@endsection
@section('script')
<script type="text/javascript">
function updateSettings(el, type){
if($(el).is(':checked')){
var value = 1;
}
else{
var value = 0;
}
$.post('{{ route('otp_configurations.update.activation') }}', {_token:'{{ csrf_token() }}', type:type, value:value}, function(data){
if(data == 1){
AIZ.plugins.notify('success', '{{ translate('Settings updated successfully') }}');
}
else{
AIZ.plugins.notify('danger', '{{ translate('Something went wrong') }}');
}
});
}
</script>
@endsection

View File

@@ -0,0 +1,28 @@
@extends('backend.layouts.app')
@section('content')
<div class="row">
@foreach ($otp_configurations as $otp_configuration)
@include('backend.otp_systems.configurations.partials.'.$otp_configuration->type)
@endforeach
</div>
@endsection
@section('script')
<script type="text/javascript">
$("#ZENDER_MODE").change(function() {
var value = $(this).val();
let changeVal = '';
if (value == "devices") {
changeVal = 'device';
} else {
changeVal = 'gateway';
}
$("#ZENDER_MODE_TYPE").val(changeVal).change();
});
</script>
@endsection

View File

@@ -0,0 +1,76 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Fast2SMS Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="fast2sms">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="AUTH_KEY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('AUTH KEY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="AUTH_KEY"
value="{{ env('AUTH_KEY') }}" placeholder="AUTH KEY" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ENTITY_ID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ENTITY ID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ENTITY_ID"
value="{{ env('ENTITY_ID') }}" placeholder="{{ translate('Entity ID') }}">
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ROUTE">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ROUTE') }}</label>
</div>
<div class="col-lg-6">
<select class="form-control aiz-selectpicker" name="ROUTE" required>
<option value="dlt_manual" @if (env('ROUTE') == 'dlt_manual') selected @endif>
{{ translate('DLT Manual') }}</option>
<option value="p" @if (env('ROUTE') == 'p') selected @endif>
{{ translate('Promotional Use') }}</option>
<option value="t" @if (env('ROUTE') == 't') selected @endif>
{{ translate('Transactional Use') }}</option>
</select>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="LANGUAGE">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('LANGUAGE') }}</label>
</div>
<div class="col-lg-6">
<select class="form-control aiz-selectpicker" name="LANGUAGE" required>
<option value="english" @if (env('LANGUAGE') == 'english') selected @endif>English
</option>
<option value="unicode" @if (env('LANGUAGE') == 'unicode') selected @endif>Unicode
</option>
</select>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="SENDER_ID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('SENDER ID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="SENDER_ID"
value="{{ env('SENDER_ID') }}" placeholder="6 digit SENDER ID">
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('MIMO Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="mimo">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="MIMO_USERNAME">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIMO_USERNAME') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIMO_USERNAME"
value="{{ env('MIMO_USERNAME') }}" placeholder="MIMO_USERNAME" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MIMO_PASSWORD">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIMO_PASSWORD') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIMO_PASSWORD"
value="{{ env('MIMO_PASSWORD') }}" placeholder="MIMO_PASSWORD" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MIMO_SENDER_ID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIMO_SENDER_ID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIMO_SENDER_ID"
value="{{ env('MIMO_SENDER_ID') }}" placeholder="MIMO_SENDER_ID" required>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('MIMSMS Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="mimsms">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="MIM_API_KEY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIM_API_KEY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIM_API_KEY"
value="{{ env('MIM_API_KEY') }}" placeholder="MIM_API_KEY" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MIM_SENDER_ID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIM_SENDER_ID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIM_SENDER_ID"
value="{{ env('MIM_SENDER_ID') }}" placeholder="MIM_SENDER_ID" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MIM_BASE_URL">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MIM_BASE_URL') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MIM_BASE_URL"
value="{{ env('MIM_BASE_URL') }}" placeholder="MIM_BASE_URL" required>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('MSEGAT Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="msegat">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="MSEGAT_API_KEY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MSEGAT_API_KEY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MSEGAT_API_KEY"
value="{{ env('MSEGAT_API_KEY') }}" placeholder="MSEGAT_API_KEY" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MSEGAT_USERNAME">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MSEGAT_USERNAME') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MSEGAT_USERNAME"
value="{{ env('MSEGAT_USERNAME') }}" placeholder="MSEGAT_USERNAME" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MSEGAT_USER_SENDER">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MSEGAT_USER_SENDER') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MSEGAT_USER_SENDER"
value="{{ env('MSEGAT_USER_SENDER') }}" placeholder="MSEGAT_USER_SENDER" required>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,50 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Nexmo Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="nexmo">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="NEXMO_KEY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('NEXMO KEY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="NEXMO_KEY" value="{{ env('NEXMO_KEY') }}"
placeholder="NEXMO KEY" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="NEXMO_SECRET">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('NEXMO SECRET') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="NEXMO_SECRET"
value="{{ env('NEXMO_SECRET') }}" placeholder="NEXMO SECRET" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="NEXMO_SENDER_ID">
<div class="col-lg-3">
<label class="col-from-label">{{translate('NEXMO SENDER ID')}}</label>
</div>
<div class="col-lg-8">
<input type="text" class="form-control" name="NEXMO_SENDER_ID" value="{{ env('NEXMO_SENDER_ID') }}" placeholder="NEXMO SENDER ID" required>
<small>
{{translate('Please check this URL for')}}
<a href="https://developer.vonage.com/en/messaging/sms/guides/custom-sender-id?source=messaging">Sender Identity</a>
{{translate('before setting the sender ID')}}
</small>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('SPARROW Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="sparrow">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="SPARROW_TOKEN">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('SPARROW_TOKEN') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="SPARROW_TOKEN"
value="{{ env('SPARROW_TOKEN') }}" placeholder="SPARROW_TOKEN" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="MESSGAE_FROM">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('MESSGAE_FROM') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="MESSGAE_FROM"
value="{{ env('MESSGAE_FROM') }}" placeholder="MESSGAE_FROM" required>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,46 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('SSL Wireless Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="ssl_wireless">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="SSL_SMS_API_TOKEN">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('SSL SMS API TOKEN') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="SSL_SMS_API_TOKEN"
value="{{ env('SSL_SMS_API_TOKEN') }}" placeholder="SSL SMS API TOKEN" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="SSL_SMS_SID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('SSL SMS SID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="SSL_SMS_SID"
value="{{ env('SSL_SMS_SID') }}" placeholder="SSL SMS SID" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="SSL_SMS_URL">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('SSL SMS URL') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="SSL_SMS_URL"
value="{{ env('SSL_SMS_URL') }}" placeholder="SSL SMS URL">
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,60 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{ translate('Twilio Credential') }}</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="twillo">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="TWILIO_SID">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('TWILIO SID') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="TWILIO_SID" value="{{ env('TWILIO_SID') }}"
placeholder="TWILIO SID" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="TWILIO_AUTH_TOKEN">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('TWILIO AUTH TOKEN') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="TWILIO_AUTH_TOKEN"
value="{{ env('TWILIO_AUTH_TOKEN') }}" placeholder="TWILIO AUTH TOKEN" required>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="VALID_TWILLO_NUMBER">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('VALID TWILIO NUMBER') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="VALID_TWILLO_NUMBER"
value="{{ env('VALID_TWILLO_NUMBER') }}" placeholder="VALID TWILLO NUMBER">
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="TWILLO_TYPE">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('TWILIO TYPE') }}</label>
</div>
<div class="col-lg-6">
<select class="form-control" name="TWILLO_TYPE">
<option value="1" {{ env('TWILLO_TYPE') < 2 ? 'selected' : false }}>SMS</option>
<option value="2" {{ env('TWILLO_TYPE') > 1 ? 'selected' : false }}>WhatsApp</option>
</select>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,106 @@
<div class="col-lg-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">Zender Credential</h5>
</div>
<div class="card-body">
<form class="form-horizontal" action="{{ route('update_credentials') }}" method="POST">
<input type="hidden" name="otp_method" value="zender">
@csrf
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_SITEURL">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_SITEURL') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ZENDER_SITEURL"
value="{{ env('ZENDER_SITEURL') }}" placeholder="https://yourzendersite.com"
required>
<small>The site url of your Zender. Do not add ending slash.</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_APIKEY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_APIKEY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ZENDER_APIKEY"
value="{{ env('ZENDER_APIKEY') }}" placeholder="ZENDER_APIKEY" required>
<small>Your Zender API key. Please make sure that it is correct and required permissions are
granted: sms_send, wa_send</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_SERVICE">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_SERVICE') }}</label>
</div>
<div class="col-lg-6">
<select class="form-control" name="ZENDER_SERVICE">
<option value="1" {{ env('ZENDER_SERVICE') < 2 ? 'selected' : false }}>SMS
</option>
<option value="2" {{ env('ZENDER_SERVICE') > 1 ? 'selected' : false }}>WhatsApp
</option>
</select>
<small>Select the sending service. Please make sure that the API key has the following
permissions: sms_send, wa_send</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_WHATSAPP">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_WHATSAPP') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ZENDER_WHATSAPP"
value="{{ env('ZENDER_WHATSAPP') }}" placeholder="ZENDER_WHATSAPP">
<small>For WhatsApp service only. WhatsApp account ID you want to use for sending.</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_DEVICE">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_DEVICE') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ZENDER_DEVICE"
value="{{ env('ZENDER_DEVICE') }}" placeholder="ZENDER_DEVICE">
<small>For SMS service only. Linked device unique ID. Please only enter this field if you
are sending using one of your devices.</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_GATEWAY">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_GATEWAY') }}</label>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="ZENDER_GATEWAY"
value="{{ env('ZENDER_GATEWAY') }}" placeholder="ZENDER_GATEWAY">
<small>For SMS service only. Partner device unique ID or gateway ID. Please only enter this
field if you are sending using a partner device or third party gateway.</small>
</div>
</div>
<div class="form-group row">
<input type="hidden" name="types[]" value="ZENDER_SIM">
<div class="col-lg-3">
<label class="col-from-label">{{ translate('ZENDER_SIM') }}</label>
</div>
<div class="col-lg-6">
<select class="form-control" name="ZENDER_SIM">
<option value="1" {{ env('ZENDER_SIM') < 2 ? 'selected' : false }}>SIM 1</option>
<option value="2" {{ env('ZENDER_SIM') > 1 ? 'selected' : false }}>SIM 2</option>
</select>
<small>For SMS service only. Select the sim slot you want to use for sending the messages.
Please only enter this field if you are sending using your device. This is ignored for
partner devices and third party gateways.</small>
</div>
</div>
<div class="form-group mb-0 text-right">
<button type="submit" class="btn btn-sm btn-primary">{{ translate('Save') }}</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,73 @@
@extends('backend.layouts.app')
@section('content')
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<h5 class="mb-0 h6">{{translate('SMS Templates')}}</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-3">
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
@foreach ($sms_templates as $key => $sms_template)
<a class="nav-link @if($sms_template->id == 1) active @endif" id="v-pills-tab-2" data-toggle="pill" href="#v-pills-{{ $sms_template->id }}" role="tab" aria-controls="v-pills-profile" aria-selected="false">{{ translate(ucwords(str_replace('_', ' ', $sms_template->identifier))) }}</a>
@endforeach
</div>
</div>
<div class="col-9">
<div class="tab-content" id="v-pills-tabContent">
@foreach ($sms_templates as $key => $sms_template)
<div class="tab-pane fade show @if($sms_template->id == 1) active @endif" id="v-pills-{{ $sms_template->id }}" role="tabpanel" aria-labelledby="v-pills-tab-1">
<form action="{{ route('sms-templates.update', $sms_template->id) }}" method="POST">
<input name="_method" type="hidden" value="PATCH">
@csrf
@if($sms_template->identifier != 'phone_number_verification' && $sms_template->identifier != 'password_reset')
<div class="form-group row">
<div class="col-md-2">
<label class="col-from-label">{{translate('Activation')}}</label>
</div>
<div class="col-md-10">
<label class="aiz-switch aiz-switch-success mb-0">
<input value="1" name="status" type="checkbox" @if ($sms_template->status == 1)
checked
@endif>
<span class="slider round"></span>
</label>
</div>
</div>
@endif
<div class="form-group row">
<label class="col-md-2 col-form-label">{{translate('SMS Body')}}</label>
<div class="col-md-10">
<textarea name="body" class="form-control" placeholder="Type.." rows="6" required>{{ $sms_template->sms_body }}</textarea>
<small class="form-text text-danger">{{ ('**N.B : Do Not Change The Variables Like [[ ____ ]].**') }}</small>
@error('body')
<small class="form-text text-danger">{{ $message }}</small>
@enderror
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">{{translate('Template ID')}}</label>
<div class="col-md-10">
<input type="text" name="template_id" value="{{ $sms_template->template_id }}" class="form-control" placeholder="{{translate('Template Id')}}">
<small class="form-text text-danger">{{ ('**N.B : Template ID is Required Only for Fast2SMS DLT Manual**') }}</small>
</div>
</div>
<div class="form-group mb-3 text-right">
<button type="submit" class="btn btn-primary">{{translate('Update Settings')}}</button>
</div>
</form>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,99 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-4">
<div class="container">
<div class="row">
<div class="col-lg-6 col-xl-5 mx-auto">
<div class="card">
<div class="card-body">
<h1 class="h3 fw-600">{{ translate('Reset Password') }}</h1>
<p class="mb-4">{{translate('Enter your phone, code and new password and confirm password.')}} </p>
<form method="POST" action="{{ route('password.update.phone') }}">
@csrf
<div class="form-group">
<input id="phone-code" type="text" class="form-control" name="phone"
placeholder="{{ translate('Phone Number') }}" required>
<span class="invalid-phone-feedback text-danger" role="alert">
</span>
</div>
<input type="hidden" id="country_code" name="country_code" value="">
<div class="form-group">
<input id="email" type="text" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="code" value="{{ $email ?? old('email') }}" placeholder="Code" required autofocus>
@if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="New Password" required>
@if ($errors->has('password'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
<div class="form-group">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" placeholder="Confirm Password" required>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">
{{ translate('Reset Password') }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection
@section('script')
<script type="text/javascript">
var isPhoneShown = true,
countryData = window.intlTelInputGlobals.getCountryData(),
input = document.querySelector("#phone-code");
for (var i = 0; i < countryData.length; i++) {
var country = countryData[i];
if(country.iso2 == 'bd'){
country.dialCode = '88';
}
}
var iti = intlTelInput(input, {
separateDialCode: true,
utilsScript: "{{ static_asset('assets/js/intlTelutils.js') }}?1590403638580",
onlyCountries: @php echo json_encode(\App\Models\Country::where('status', 1)->pluck('code')->toArray()) @endphp,
customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
if(selectedCountryData.iso2 == 'bd'){
return "01xxxxxxxxx";
}
return selectedCountryPlaceholder;
}
});
var country = iti.getSelectedCountryData();
$('input[name=country_code]').val(country.dialCode);
input.addEventListener("countrychange", function(e) {
// var currentMask = e.currentTarget.placeholder;
var country = iti.getSelectedCountryData();
$('input[name=country_code]').val(country.dialCode);
});
</script>
@endsection

View File

@@ -0,0 +1,36 @@
@extends('frontend.layouts.app')
@section('content')
<section class="py-4">
<div class="container">
<div class="row">
<div class="col-lg-6 col-xl-5 mx-auto">
<div class="card">
<div class="text-center pt-5">
<h1 class="h2 fw-600">
{{translate('Phone Verification')}}
</h1>
<p>Verification code has been sent. Please wait a few minutes.</p>
<a href="{{ route('verification.phone.resend') }}" class="btn btn-link">{{translate('Resend Code')}}</a>
</div>
<div class="px-5 py-lg-5">
<div class="row align-items-center">
<div class="col-12 col-lg">
<form class="form-default" role="form" action="{{ route('verification.submit') }}" method="POST">
@csrf
<div class="form-group">
<div class="input-group input-group--style-1">
<input type="text" class="form-control" name="verification_code">
</div>
</div>
<button type="submit" class="btn btn-primary btn-block">{{ translate('Verify') }}</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endsection

View File

@@ -0,0 +1,48 @@
@extends('backend.layouts.app')
@section('content')
<div class="row">
<div class="col-lg-6 mx-auto">
<div class="card">
<div class="card-header">
<h3 class="fs-18 mb-0">{{translate('Send Bulk SMS')}}</h3>
</div>
<form class="form-horizontal" action="{{ route('sms.send') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="card-body">
<div class="form-group row">
<label class="col-sm-2 control-label" for="name">{{translate('Mobile Users')}}</label>
<div class="col-sm-10">
<select class="form-control aiz-selectpicker" data-live-search="true" name="user_phones[]" multiple>
@foreach($users as $user)
@if ($user->phone != null)
<option value="{{$user->phone}}">{{$user->name}} - {{$user->phone}}</option>
@endif
@endforeach
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 control-label" for="name">{{translate('SMS content')}}</label>
<div class="col-sm-10">
<textarea class="form-control" name="content" required></textarea>
</div>
</div>
<div class="form-group row">
<label class="col-md-2 col-form-label">{{translate('Template ID')}}</label>
<div class="col-md-10">
<input type="text" name="template_id" class="form-control" placeholder="{{translate('Template Id')}}">
<small class="form-text text-danger">{{ ('**N.B : Template ID is Required Only for Fast2SMS DLT Manual **') }}</small>
</div>
</div>
</div>
<div class="card-footer">
<button class="btn btn-primary" type="submit">{{translate('Send')}}</button>
</div>
</form>
</div>
</div>
</div>
@endsection