You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BusinessController.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. <?php
  2. namespace App\Http\Controllers\Form;
  3. use Illuminate\Http\Request;
  4. use App\Http\Controllers\Controller;
  5. use Illuminate\Support\Facades\Auth;
  6. use App\Mail\CustomerBInvoice;
  7. use App\Jobs\SendCustomerInvoiceB;
  8. use Carbon\Carbon;
  9. use Validator;
  10. use File;
  11. use App\Model\Coverage;
  12. use App\Model\Product;
  13. use App\Model\Form;
  14. use App\Model\Subscriber;
  15. use App\Model\PackageDetail;
  16. use App\Model\FormStatus;
  17. use App\Staff;
  18. use App\Model\StaffDetail;
  19. class BusinessController extends Controller
  20. {
  21. public function successSubmit(){
  22. return view('sales.form.after_submit_form');
  23. }
  24. public function successVerified(){
  25. return view('sales.form.success_verify');
  26. }
  27. public function sendInvoice($subscriber_id) {
  28. $subscriber = Subscriber::with('Form')->where('subscriber_id',$subscriber_id)->first();
  29. $form = Form::with('Subscriber','PackageDetail')->where('_id',$subscriber->_id)->first();
  30. $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$form->type_application)->first();
  31. SendCustomerInvoiceB::dispatch($form, $product, $form->Subscriber->email);
  32. return $form->_id;
  33. }
  34. function random_code($limit) {
  35. return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit);
  36. }
  37. public function viewFormAddress($package) {
  38. $dealer_id = '';
  39. return view('sales.form.business_address', compact('package','dealer_id'));
  40. }
  41. public function viewFormApplication(Request $request) {
  42. $data = array();
  43. array_push($data, array(
  44. 'unit_no' => $request->unit_no,
  45. 'caddress' => $request->caddress,
  46. 'ccity' => $request->ccity,
  47. 'cstate' => $request->cstate,
  48. 'postcode' => $request->postcode,
  49. 'package' => $request->package
  50. ));
  51. return view('sales.form.business_application_information', compact('data'));
  52. }
  53. public function viewFormPackage(Request $request)
  54. {
  55. $data = array();
  56. array_push($data, array(
  57. 'unit_no' => $request->unit_no,
  58. 'caddress' => $request->caddress,
  59. 'ccity' => $request->ccity,
  60. 'cstate' => $request->cstate,
  61. 'postcode' => $request->postcode,
  62. 'package' => $request->package,
  63. 'application' => $request->application,
  64. 'company_name' => $request->company_name,
  65. 'company_register' => $request->company_register,
  66. 'company_number' => $request->company_number,
  67. 'company_fax' => $request->company_fax,
  68. 'full_name' => $request->full_name,
  69. 'nric_passport' => $request->nric_passport,
  70. 'designation' => $request->designation,
  71. 'contact_primary' => $request->contact_primary,
  72. 'contact_secondary' => $request->contact_secondary,
  73. 'email' => $request->email,
  74. ));
  75. $pg = $request->package;
  76. return view('sales.form.business_package', compact('data','pg'));
  77. }
  78. public function viewFormPreview(Request $request){
  79. $data = array();
  80. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  81. $otc = 0.0;
  82. $total_monthly = 0;
  83. $gst ='';
  84. $promo_st = '';
  85. $voice = "No";
  86. if($request->voice == "Yes"){
  87. $voice = $request->voice;
  88. $voice_price = 20;
  89. }else {
  90. $voice = "No";
  91. $voice_price = 0;
  92. }
  93. $ip_fee = 0; $ip_tax = 0;
  94. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  95. $ip_fee = 200 ;
  96. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  97. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  98. $ip_fee = 400;
  99. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  100. }
  101. if ($request->package != "1Gbps" && $request->subscription == '24'){
  102. $promo_price = number_format(floatval($product->retail_price) - 10);
  103. $promo_st = number_format(floatval($promo_price) * 1.06,2);
  104. $total_monthly = number_format($promo_st + ($voice_price * 1.06) + $ip_tax, 2);
  105. }
  106. else if ($request->package == "1Gbps"){
  107. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  108. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  109. $total_monthly = 3920.94;
  110. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  111. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  112. $total_monthly = 4132.94;
  113. }else{
  114. $gst = 3708.94;
  115. $total_monthly = 3708.94;
  116. }
  117. }else{
  118. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  119. $total_monthly = number_format($gst + ($voice_price * 1.06) + $ip_tax, 2);
  120. }
  121. if($request->subscription == '12' && $voice == 'No'){
  122. $otc = 300;
  123. $deposit = $product->deposit;
  124. }else if( $request->subscription == '12' && $voice == 'Yes'){
  125. $otc = 300 + 100;
  126. $deposit = $product->deposit;
  127. }else {
  128. $otc = 0.0;
  129. $deposit = $product->deposit;
  130. }
  131. $otc_st = number_format(floatval($otc) * 1.06,2);
  132. $upfront_total = number_format(floatval($otc_st) + $deposit,2);
  133. $total = number_format((floatval($product->retail_price) * 1.06) + ($otc * 1.06) + $deposit + $ip_tax, 2);
  134. array_push($data, array(
  135. 'unit_no' => $request->unit_no,
  136. 'caddress' => $request->caddress,
  137. 'ccity' => $request->ccity,
  138. 'cstate' => $request->cstate,
  139. 'postcode' => $request->postcode,
  140. 'package' => $request->package,
  141. 'application' => $request->application,
  142. 'company_name' => $request->company_name,
  143. 'company_register' => $request->company_register,
  144. 'company_number' => $request->company_number,
  145. 'company_fax' => $request->company_fax,
  146. 'full_name' => $request->full_name,
  147. 'nric_passport' => $request->nric_passport,
  148. 'designation' => $request->designation,
  149. 'contact_primary' => $request->contact_primary,
  150. 'contact_secondary' => $request->contact_secondary,
  151. 'email' => $request->email,
  152. 'subscription' => $request->subscription,
  153. 'billing' => $request->billing,
  154. 'voice' => $voice,
  155. 'ip' => $request->ip,
  156. 'ip_fee' => $ip_fee,
  157. 'ip_tax' => $ip_tax,
  158. 'thedate' => $request->thedate,
  159. ));
  160. return view('sales.form.business_preview', compact('data','coverage','product','deposit','otc', 'otc_st','gst','promo_price','promo_st','total_monthly', 'upfront_total'));
  161. }
  162. public function storeFormData(Request $request){
  163. $su_id = ''; $pathIconF = ''; $pathIconB = ''; $pathForm9 = '';
  164. do {
  165. $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
  166. } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
  167. $destinationPath = 'document/'.$su_id;
  168. // create folder/dir if not exist
  169. info(public_path());
  170. if(!File::exists(public_path().'/'.$destinationPath)){
  171. File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
  172. }
  173. if($request->hasfile('front_ic')){
  174. $icon = $request->file('front_ic');
  175. $icon->move($destinationPath,'frontic.'.$icon->getClientOriginalExtension());
  176. $pathIconF = '/'.$destinationPath.'/frontic.'.$icon->getClientOriginalExtension();
  177. }
  178. if($request->hasfile('back_ic')){
  179. $icon = $request->file('back_ic');
  180. $icon->move($destinationPath,'backic.'.$icon->getClientOriginalExtension());
  181. $pathIconB = '/'.$destinationPath.'/backic.'.$icon->getClientOriginalExtension();
  182. }
  183. if($request->hasfile('form9')){
  184. $icon = $request->file('form9');
  185. $icon->move($destinationPath,'formD.'.$icon->getClientOriginalExtension());
  186. $pathForm9 = '/'.$destinationPath.'/formD.'.$icon->getClientOriginalExtension();
  187. }
  188. if($pathForm9 != '' && $pathIconB != '' && $pathIconF != ''){
  189. $sl = Form::create([
  190. 'type_service' => $request->application,
  191. 'type_application' => 'B',
  192. 'status_payment' => 'paid',
  193. 'status_email' => 'unverified',
  194. 'remark_form' => ''
  195. ]);
  196. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  197. $sdl = new Subscriber();
  198. $sdl->subscriber_id = $su_id;
  199. $sdl->name = $request->full_name;
  200. $sdl->ic = $request->nric_passport;
  201. $sdl->company_name = $request->company_name;
  202. $sdl->company_reg = $request->company_register;
  203. $sdl->company_num = $request->company_number;
  204. $sdl->company_fax = $request->company_fax;
  205. $sdl->designation = $request->designation;
  206. $sdl->email = $request->email;
  207. $sdl->phone1 = $request->contact_primary;
  208. $sdl->phone2 = $request->contact_secondary;
  209. $sdl->unit_no = $request->unit_no;
  210. $sdl->street = $request->caddress;
  211. $sdl->postcode = $request->postcode;
  212. $sdl->city = $request->ccity;
  213. $sdl->state = $request->cstate;
  214. $sdl->front_ic = $pathIconF;
  215. $sdl->back_ic = $pathIconB;
  216. $sdl->form9_44 = $pathForm9;
  217. $packageD = new PackageDetail();
  218. $packageD->contract = $request->subscription;
  219. $packageD->name = $product->speed;
  220. if ($request->gst != null){
  221. $packageD->montly_fee = $request->gst;
  222. }else {
  223. $packageD->montly_fee = $request->promo_st;
  224. }
  225. $packageD->voice_fee = $request->voice;
  226. $packageD->ip = $request->ip;
  227. $packageD->deposit = $request->deposit;
  228. $packageD->upfront_payment = $request->otc;
  229. $packageD->ip_tax = $request->ip_tax;
  230. $packageD->rfs = $request->rfs;
  231. $sl->subscriber()->save($sdl);
  232. $sl->packagedetail()->save($packageD);
  233. $f_id = $this->sendInvoice($su_id);
  234. $stat = new FormStatus();
  235. $stat->form_id = $f_id;
  236. $stat->status_id = 1;
  237. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  238. $stat->status = 'Submitted';
  239. $stat->desc = 'The form already been submit';
  240. $sl->formstatus()->save($stat);
  241. return redirect('http://db.citybroadband.my/business/application-form/success-submit');
  242. }
  243. }
  244. /***
  245. ** Dealer
  246. ***/
  247. public function viewFormAddressD($package,$dealer_id) {
  248. return view('sales.form.dealer.business_address', compact('package','dealer_id'));
  249. }
  250. public function viewFormApplicationD(Request $request) {
  251. $data = array();
  252. array_push($data, array(
  253. 'unit_no' => $request->unit_no,
  254. 'caddress' => $request->caddress,
  255. 'ccity' => $request->ccity,
  256. 'cstate' => $request->cstate,
  257. 'postcode' => $request->postcode,
  258. 'package' => $request->package,
  259. 'dealer_id' => $request->dealer_id,
  260. ));
  261. return view('sales.form.dealer.business_application_information', compact('data'));
  262. }
  263. public function viewFormPackageD(Request $request)
  264. {
  265. $data = array();
  266. array_push($data, array(
  267. 'unit_no' => $request->unit_no,
  268. 'caddress' => $request->caddress,
  269. 'ccity' => $request->ccity,
  270. 'cstate' => $request->cstate,
  271. 'postcode' => $request->postcode,
  272. 'package' => $request->package,
  273. 'application' => $request->application,
  274. 'company_name' => $request->company_name,
  275. 'company_register' => $request->company_register,
  276. 'company_number' => $request->company_number,
  277. 'company_fax' => $request->company_fax,
  278. 'full_name' => $request->full_name,
  279. 'nric_passport' => $request->nric_passport,
  280. 'ip' => $request->ip,
  281. 'designation' => $request->designation,
  282. 'contact_primary' => $request->contact_primary,
  283. 'contact_secondary' => $request->contact_secondary,
  284. 'email' => $request->email,
  285. 'dealer_id' => $request->dealer_id,
  286. ));
  287. $pg = $request->package;
  288. return view('sales.form.dealer.business_package', compact('data','pg'));
  289. }
  290. public function viewFormPreviewD(Request $request){
  291. $data = array();
  292. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  293. $otc = 0.0;
  294. $total_monthly = 0;
  295. $gst ='';
  296. $promo_st = '';
  297. $voice = "No";
  298. if($request->voice == "Yes"){
  299. $voice = $request->voice;
  300. $voice_price = 20;
  301. }else {
  302. $voice = "No";
  303. $voice_price = 0;
  304. }
  305. $ip_fee = 0; $ip_tax = 0;
  306. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  307. $ip_fee = 200 ;
  308. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  309. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  310. $ip_fee = 400;
  311. $ip_tax = number_format((floatval($ip_fee) * 1.06),2);
  312. }
  313. if ($request->package != "1Gbps" && $request->subscription == '24'){
  314. $promo_price = number_format(floatval($product->retail_price) - 10);
  315. $promo_st = number_format(floatval($promo_price) * 1.06,2);
  316. $total_monthly = number_format($promo_st + ($voice_price * 1.06) + $ip_tax, 2);
  317. }
  318. else if ($request->package == "1Gbps"){
  319. if ($request->ip == "1 Fixed IP RM200/1P/Month") {
  320. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  321. $total_monthly = 3920.94;
  322. }elseif ($request->ip == "5 Fixed IP RM400/1P/Month") {
  323. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  324. $total_monthly = 4132.94;
  325. }else{
  326. $gst = 3708.94;
  327. $total_monthly = 3708.94;
  328. }
  329. }
  330. else{
  331. $gst = number_format(floatval($product->retail_price) * 1.06,2);
  332. $total_monthly = number_format($gst + ($voice_price * 1.06) + $ip_tax, 2);
  333. }
  334. if($request->subscription == '12' && $voice == 'No'){
  335. $otc = 300;
  336. $deposit = $product->deposit;
  337. }else if( $request->subscription == '12' && $voice == 'Yes'){
  338. $otc = 300 + 100;
  339. $deposit = $product->deposit;
  340. }else {
  341. $otc = 0.0;
  342. $deposit = $product->deposit;
  343. }
  344. $otc_st = number_format(floatval($otc) * 1.06,2);
  345. $upfront_total = number_format(floatval($otc_st) + $deposit,2);
  346. $total = number_format((floatval($product->retail_price) * 1.06) + ($otc * 1.06) + $deposit + $ip_tax, 2);
  347. array_push($data, array(
  348. 'unit_no' => $request->unit_no,
  349. 'caddress' => $request->caddress,
  350. 'ccity' => $request->ccity,
  351. 'cstate' => $request->cstate,
  352. 'postcode' => $request->postcode,
  353. 'package' => $request->package,
  354. 'application' => $request->application,
  355. 'company_name' => $request->company_name,
  356. 'company_register' => $request->company_register,
  357. 'company_number' => $request->company_number,
  358. 'company_fax' => $request->company_fax,
  359. 'full_name' => $request->full_name,
  360. 'nric_passport' => $request->nric_passport,
  361. 'designation' => $request->designation,
  362. 'contact_primary' => $request->contact_primary,
  363. 'contact_secondary' => $request->contact_secondary,
  364. 'email' => $request->email,
  365. 'subscription' => $request->subscription,
  366. 'billing' => $request->billing,
  367. 'voice' => $voice,
  368. 'ip' => $request->ip,
  369. 'ip_fee' => $ip_fee,
  370. 'ip_tax' => $ip_tax,
  371. 'thedate' => $request->thedate,
  372. 'dealer_id' => $request->dealer_id,
  373. ));
  374. return view('sales.form.dealer.business_preview', compact('data','coverage','product','deposit','otc', 'otc_st','gst','promo_price','promo_st','total_monthly', 'upfront_total'));
  375. }
  376. public function storeFormDataD(Request $request){
  377. $su_id = ''; $pathIconF = ''; $pathIconB = ''; $pathForm9 = ''; $pathPaymentReceipt = ''; $pathSoForm = '';
  378. do {
  379. $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
  380. } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
  381. $destinationPath = 'document/'.$su_id;
  382. // create folder/dir if not exist
  383. if(!File::exists(public_path().'/'.$destinationPath)){
  384. File::makeDirectory(public_path().'/'.$destinationPath,0777,true);
  385. }
  386. if($request->hasfile('front_ic')){
  387. $icon = $request->file('front_ic');
  388. $icon->move($destinationPath,'frontic.'.$icon->getClientOriginalExtension());
  389. $pathIconF = '/'.$destinationPath.'/frontic.'.$icon->getClientOriginalExtension();
  390. }
  391. if($request->hasfile('back_ic')){
  392. $icon = $request->file('back_ic');
  393. $icon->move($destinationPath,'backic.'.$icon->getClientOriginalExtension());
  394. $pathIconB = '/'.$destinationPath.'/backic.'.$icon->getClientOriginalExtension();
  395. }
  396. if($request->hasfile('form9')){
  397. $icon = $request->file('form9');
  398. $icon->move($destinationPath,'formD.'.$icon->getClientOriginalExtension());
  399. $pathForm9 = '/'.$destinationPath.'/formD.'.$icon->getClientOriginalExtension();
  400. }
  401. if($request->hasfile('paymentReceipt')){
  402. $icon = $request->file('paymentReceipt');
  403. $icon->move($destinationPath,'paymentReceipt.'.$icon->getClientOriginalExtension());
  404. $pathPaymentReceipt = '/'.$destinationPath.'/paymentReceipt.'.$icon->getClientOriginalExtension();
  405. }
  406. if($request->hasfile('soForm')){
  407. $icon = $request->file('soForm');
  408. $icon->move($destinationPath,'soForm.'.$icon->getClientOriginalExtension());
  409. $pathSoForm = '/'.$destinationPath.'/soForm.'.$icon->getClientOriginalExtension();
  410. }
  411. if($pathForm9 != '' && $pathIconB != '' && $pathIconF != ''){
  412. $staff = Staff::with('StaffDetail')->where('_id',$request->dealer_id)->first();
  413. if(!empty($staff)){
  414. $sl = new Form();
  415. $sl->type_service = $request->application;
  416. $sl->type_application = 'B';
  417. $sl->status_payment = 'paid';
  418. $sl->status_email = 'unverified';
  419. $sl->remark_form = '';
  420. $sl->dealer_id = $request->dealer_id;
  421. $sl->company_id = $staff->StaffDetail->company_id;
  422. $staff->form()->save($sl);
  423. $coverage = Coverage::where('_id',$request->coverage)->first();
  424. $product = Product::where('formT','B')->where('package_name',$request->package)->first();
  425. $sdl = new Subscriber();
  426. $sdl->subscriber_id = $su_id;
  427. $sdl->name = $request->full_name;
  428. $sdl->ic = $request->nric_passport;
  429. $sdl->company_name = $request->company_name;
  430. $sdl->company_reg = $request->company_register;
  431. $sdl->company_num = $request->company_number;
  432. $sdl->company_fax = $request->company_fax;
  433. $sdl->designation = $request->designation;
  434. $sdl->email = $request->email;
  435. $sdl->phone1 = $request->contact_primary;
  436. $sdl->phone2 = $request->contact_secondary;
  437. $sdl->unit_no = $request->unit_no;
  438. $sdl->street = $request->caddress;
  439. $sdl->postcode = $request->postcode;
  440. $sdl->city = $request->ccity;
  441. $sdl->state = $request->cstate;
  442. $sdl->front_ic = $pathIconF;
  443. $sdl->back_ic = $pathIconB;
  444. $sdl->form9_44 = $pathForm9;
  445. $sdl->paymentReceipt = $pathPaymentReceipt;
  446. $sdl->soForm = $pathSoForm;
  447. $packageD = new PackageDetail();
  448. $packageD->contract = $request->subscription;
  449. $packageD->name = $product->speed;
  450. if ($request->gst != null){
  451. $packageD->montly_fee = $request->gst;
  452. }else {
  453. $packageD->montly_fee = $request->promo_st;
  454. }
  455. $packageD->voice_fee = $request->voice;
  456. $packageD->ip = $request->ip;
  457. $packageD->ip_tax = $request->ip_tax;
  458. $packageD->deposit = $request->deposit;
  459. $packageD->upfront_payment = $request->otc;
  460. $packageD->rfs = $request->rfs;
  461. $sl->subscriber()->save($sdl);
  462. $sl->packagedetail()->save($packageD);
  463. $f_id = $this->sendInvoice($su_id);
  464. $stat = new FormStatus();
  465. $stat->form_id = $f_id;
  466. $stat->status_id = 1;
  467. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  468. $stat->status = 'Submitted';
  469. $stat->desc = 'The form already been submit';
  470. $sl->formstatus()->save($stat);
  471. return redirect('http://db.citybroadband.my/business/application-form/success-submit');
  472. }
  473. }
  474. }
  475. public function verifyEmail($subscriber_id){
  476. $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first();
  477. if(!empty($subscriber)){
  478. $form = Form::where('_id',$subscriber->_id)->first();
  479. if(!empty($form)){
  480. if($form->status_email == 'unverified'){
  481. $form->status_email = 'verified';
  482. $form->save();
  483. $stat = new FormStatus();
  484. $stat->form_id = $form->_id;
  485. $stat->status_id = 2;
  486. $stat->date = new \MongoDB\BSON\UTCDateTime(time()*1000);
  487. $stat->status = 'Verified';
  488. $stat->desc = 'Email already been verified by customer';
  489. $form->formstatus()->save($stat);
  490. return redirect('http://db.citybroadband.my/business/application-form/success-verified');
  491. }
  492. }
  493. }
  494. }
  495. public function checkEmailTemplate($subscriber_id){
  496. $subscriber = Subscriber::where('subscriber_id',$subscriber_id)->first();
  497. if(!empty($subscriber)){
  498. $form = Form::where('_id',$subscriber->_id)->first();
  499. $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$form->type_application)->first();
  500. }
  501. return view('email.invoiceb', compact ('form', 'product'));
  502. }
  503. }