[1.x] Allow overriding the default table name.#55
[1.x] Allow overriding the default table name.#55hrabbit wants to merge 1 commit intoLaragear:1.xfrom
Conversation
This feature users to override the default table created during a
migration by adding a configuration entry for the new table name.
Added config entry to allow setting a value, without this entry, or null
drops back to the existing behavior.
```
'table_name' => null,
```
Added fallback for table name in model.
```
public function getTable()
{
return config('two-factor.table_name') ?? parent::getTable();
}
```
|
Kudos, SonarCloud Quality Gate passed!
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## 1.x #55 +/- ##
=========================================
Coverage 99.75% 99.75%
- Complexity 140 141 +1
=========================================
Files 18 18
Lines 408 410 +2
=========================================
+ Hits 407 409 +2
Misses 1 1
☔ View full report in Codecov by Sentry. |
|
Not a fan of having migration configuration in a config file. I'll rather set the table name using a static property in the model, which the migration would pick up magically. I'll use that approach to add this enhancement. Thanks. |
Sure thing. When you update, I'll be sure to update, in the meantime, my local mods are working as expected. PS. Loving the package btw! Saved heaps of dev time on my end! |
|
@hrabbit thanks, great to know it helps. If you have time, you can make a PR. |
|
Went my own way #72 |








This feature users to override the default table created during a migration by adding a configuration entry for the new table name.
Added config entry to allow setting a value, without this entry, or null drops back to the existing behavior.
Added fallback for table name in model.