Skip to content

Commit f5e17e9

Browse files
Merge pull request #22 from tirjok/hotfix/remove-duplicate-query
This fixes remove duplicate query running from account controller.
2 parents 20dd9c8 + 4efa7f0 commit f5e17e9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

app/Http/Controllers/AccountController.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
use Auth;
88
use Hash;
99
use Cloudder;
10-
use App\User;
1110
use App\Http\Requests;
12-
use App\Http\Controllers\Controller;
13-
1411

1512
class AccountController extends Controller
1613
{
@@ -19,15 +16,13 @@ class AccountController extends Controller
1916

2017
public function __construct()
2118
{
22-
$this->id = Auth::user()->id;
23-
$this->user = User::findOrFail($this->id);
19+
$this->user = Auth::user();
20+
$this->id = $this->user->id;
2421
}
2522

2623
public function getAccountPage()
2724
{
28-
$details = User::whereId($this->id)->first();
29-
30-
return view('account.dashboard')->withAccount($details);
25+
return view('account.dashboard')->withAccount($this->user);
3126
}
3227

3328
/**

0 commit comments

Comments
 (0)