Skip to content

Commit 1306f75

Browse files
committed
Installation: Patch for sqlite: Don't use Member model to update data.
1 parent cef51cf commit 1306f75

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/Controllers/InstallController.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ public function setup(Request $request)
178178
]);
179179

180180
// Add current user to panichd_admin
181-
$admin = Member::find(auth()->user()->id);
182-
$admin->panichd_admin = true;
181+
$admin_user = User::find(auth()->user()->id);
182+
$admin_user->panichd_admin = true;
183183

184184
if ($request->has('quickstart')){
185185
// Insert quickstart seed data
@@ -188,11 +188,14 @@ public function setup(Request $request)
188188
]);
189189

190190
// Add current user as an agent in the last added category
191-
$admin->panichd_agent = true;
192-
$admin->categories()->sync([Category::first()->id]);
191+
$admin_user->panichd_agent = true;
192+
193+
// App\User doesn't have categories()
194+
$admin_member = Member::find(auth()->user()->id);
195+
$admin_member->categories()->sync([Category::first()->id]);
193196
}
194197

195-
$admin->save();
198+
$admin_user->save();
196199

197200
\Cache::forget('panichd::installation');
198201

0 commit comments

Comments
 (0)