Skip to content

Commit 148e034

Browse files
committed
sqlite table list issue fix
1 parent bc2c31b commit 148e034

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Controllers/ActivityController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ class ActivityController extends Controller
1212
{
1313
private $userInstance = "\App\User";
1414

15-
public function __construct() {
15+
public function __construct()
16+
{
1617
$userInstance = config('user-activity.model.user');
17-
if(!empty($userInstance)) $this->userInstance = $userInstance;
18+
if (!empty($userInstance)) $this->userInstance = $userInstance;
1819
}
1920

2021
private function handleData(Request $request)
@@ -113,15 +114,19 @@ public function getIndex(Request $request)
113114
);
114115
$all = array_map('current', DB::select($sql));
115116
break;
117+
case 'sqlite':
118+
$sql = "SELECT name as table_name FROM sqlite_master WHERE type='table' ORDER BY name";
119+
$all = array_map('current', DB::select($sql));
120+
break;
116121
default:
117122
$all = array_map('current', DB::select('SHOW TABLES'));
118123
}
124+
119125
$exclude = ['failed_jobs', 'password_resets', 'migrations', 'logs'];
120126
$tables = array_diff($all, $exclude);
121127

122128
return view('LaravelUserActivity::index', ['tables' => $tables]);
123129

124-
125130
}
126131

127132
public function handlePostRequest(Request $request)

0 commit comments

Comments
 (0)