我要获取category_table的数据,其中company_id等于select_companies的表的pan_code列
public function index(){
$user = Auth::user()->id;
$company = DB::select('select pan_code from select_companies where user_id = ?', [$user]);
$datas = DB::select('select * from categories where company_id = ?', [$company]);
return view('Category.category')->with('datas', $datas)->with('company', $company);
}