class SampleELoq extends Model
{
use SoftDeletes;
public function conditionFields() {
return $this->belongsToMany('App\EloquentModel\ConditionField');
}
}
nameSpace is the name space of the SampleELoq
$Eloq = $nameSpace::find(1);
$table = with(new $nameSpace->conditionFields)->getTable();
print_r(Schema::getColumnListing($table));
How can i able to get the table name of the conditionFields?