<?php

namespace App\Http\Controllers\Backend\User;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Yajra\DataTables\DataTables;
use Illuminate\Support\Facades\Auth;
use App\Models\Blog;
use App\Models\Template;
use App\Models\User;
use App\Models\WhatsappApi;
use Illuminate\Support\Facades\Http;
use View;
use Illuminate\Support\Facades\DB;


class TemplateController extends Controller
{
   public function gettemplatecontent(Request $request, Blog $blog)
   {

      if ($request->ajax()) {
         $user_data = Auth::user();
         if ($request->has('id')) {
            $search = $request->id;
            $data = Template::find($search);
            // ("id", "template_name", "template_lang", "template_text", "hader_format", "hader_text", "body_text", "footer_text")
            //    ->where('id', '=', $search)
            //    ->where('user_id', '=', $user_data->id)
            //    ->where('status', '=', 1)
            //    ->get()->first();
         }
         return response()->json([
            'id' => $data
         ]);
      }
   }
}
