<?php

namespace App\Models;

use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class Template extends Model
{
    public function getContent($template_id)
    {
        $dicounts = DB::table('template')
            ->select('id')
            ->where('template_id', $template_id)
            ->where('status', 1)
            ->get();
    }
    public function getAll($template_id)
    {
        $dicounts = DB::table('template')
            ->select('id', 'template_name')
            ->where('template_id', $template_id)
            ->where('status', 1)
            ->get();
    }
    // Update templates from Whatsapp manager
    public static function  delTemplates()
    {
        $res = Template::where('accounts_id', session('account_id'))->delete();
    }
}
