*/ abstract class AbstractMetricRepository { /** * The illuminate config repository. * * @var \Illuminate\Contracts\Config\Repository */ protected $config; /** * The name of the metrics table. * * @var string */ protected $tableName; /** * Create a new abstract metric repository instance. * * @param \Illuminate\Contracts\Config\Repository $config * * @return void */ public function __construct(Repository $config) { $this->config = $config; } /** * Get the metrics table name. * * @return string */ protected function getTableName() { $driver = $this->config->get('database.default'); $connection = $this->config->get('database.connections.'.$driver); $prefix = $connection['prefix']; return $prefix.'metrics'; } }