<?php

namespace App\Http\Controllers\Lumina;

use App\Http\Controllers\Api\SIPHConnectController;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
use Image;
use Exception;
use App\Models\Mongo;
use App\Models\Department;
use stdClass;

class VideoPreviewController extends Controller
{
    public function __construct() { login_lumina(); }

    public function index(Request $r){
        $lumina = (object) Mongo::table('tb_lumina')->where('id', 1)->first();
        $case   = (object) Mongo::table('tb_case')->where('_id', $r->id)->first();
        $videos  = @$case->video ?? [];
        $video   = $videos[@$r->vdo_id.""] ?? '';
        $admin = getCONFIG('admin');
        $view['case'] = $case;
        $view['cid'] = $r->cid;
        $view['videoname'] = $video;
        $view['store_url'] = $admin->store_url;
        // store_url
        // dd($r);
        $view['path'] = $r->vdo_path;
        return view('lumina.preview.index', $view);
    }

    public function show($id){

        dd($id);

    }

    public function store(Request $r){

    }
}
