Skip to content

Commit 31ed92c

Browse files
committed
Table name configuratble
1 parent 77f2a41 commit 31ed92c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

config/kvstorage.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@
1616

1717
'method' => 'database',
1818

19+
/*
20+
|--------------------------------------------------------------------------
21+
| DB Table Name
22+
|--------------------------------------------------------------------------
23+
|
24+
| You can define the table name of the key value storage.
25+
|
26+
*/
27+
28+
'table_name' => 'kv_storage',
29+
1930
/*
2031
|--------------------------------------------------------------------------
2132
| Storage Driver

src/KVOption.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class KVOption extends Model
1818
*
1919
* @var string
2020
*/
21-
protected $table = 'kv_storage';
21+
public function getTable()
22+
{
23+
return config('kvstorage.table_name', 'kv_storage');
24+
}
2225

2326
/**
2427
* The attributes that are mass assignable.

0 commit comments

Comments
 (0)