<?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\systemAdministration\SubCategory;

class AjaxController extends Controller
{
    public function get_category(Request $request)
    {
        $data="";
        $categories = SubCategory::where("category_id", $request->cat_id)->get();
        $data.= "<option>سب کټګوری انتحاب کړی</option>";
        foreach ($categories as $row) {
            $data .= "<option value='$row->id'>$row->title_ps</option>";
        }
        return $data;

    }

}
