A method inside the controller in Laravel.
public function getValue()
{
     $dataA[] = TableA::all('name');
     $dataB[] = TableB::all('question');
     for ($i =0; $i <= count($dataA); $i++)
     {
         $data = DB::table($dataA[$i]->name)
             ->select(SELECT * from $dataA[$i]->name)
             ->where($dataB[$i]->question '!=' null)
             ->get();
     }
}
Got
ParseError
syntax error, unexpected '$dataA' (T_VARIABLE), expecting ')' 
Could someone please help to resolve the issue?
Thanks.
 
     
    