<?php

namespace App\Http\Controllers\Backend\User;

use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use App\Models\Users\BroadcastLog;
use Illuminate\Http\Request;

class BroadcastLogController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }




    /**
     * 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)
    {
        //
    }
    public function showlog($id)
    {
        $broadcaste = BroadcastLog::Select('broadcaste.id', 'broadcaste.broadcast_name', 'templates.template_name', 'broadcast_log.to_number', 'broadcast_log.to_number', 'broadcast_log.response_code')
            ->join('broadcaste', 'broadcaste.id', '=', 'broadcast_log.broadcast_id')
            ->join('templates', 'templates.template_id', '=', 'broadcast_log.template_metaid')
            ->where('broadcast_log.account_id', '=',  session('account_id'))
            ->where('broadcast_log.broadcast_id', '=',  $id)
            ->get();

        $data['broadcaste'] = $broadcaste;
        return view('backend.user.broadcastlog.index', $data);
    }
    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        echo $_GET['id'];
        echo "here";
    }

    /**
     * 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)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
