|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Http\Controllers; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Http\Request; |
|
6
|
|
|
use App\Models\AccountModel; |
|
7
|
|
|
use App\Models\Eloquent\User; |
|
8
|
|
|
use App\Models\Eloquent\UserExtra; |
|
9
|
|
|
use App\Models\Eloquent\Tool\Socialite; |
|
10
|
|
|
use Auth; |
|
11
|
|
|
|
|
12
|
|
|
class UserController extends Controller |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* Show the account index. |
|
16
|
|
|
* |
|
17
|
|
|
* @return \Illuminate\View\View |
|
18
|
|
|
*/ |
|
19
|
|
|
public function index() |
|
20
|
|
|
{ |
|
21
|
|
|
return redirect("/"); |
|
|
|
|
|
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* Show the account dashboard. |
|
26
|
|
|
* |
|
27
|
|
|
* @return \Illuminate\View\View |
|
28
|
|
|
*/ |
|
29
|
|
|
public function view($uid) |
|
30
|
|
|
{ |
|
31
|
|
|
$accountModel=new AccountModel(); |
|
32
|
|
|
$info=$accountModel->detail($uid); |
|
33
|
|
|
if ($info==null) { |
|
34
|
|
|
return redirect("/"); |
|
|
|
|
|
|
35
|
|
|
} |
|
36
|
|
|
$feed=$accountModel->feed($uid); |
|
37
|
|
|
$extraInfo=User::find($uid)->getExtra(['gender', 'contact', 'school', 'country', 'location'], 0); |
|
38
|
|
|
$socialiteInfo=User::find($uid)->getSocialiteInfo(0); |
|
39
|
|
|
return view("account.dashboard", [ |
|
40
|
|
|
'page_title'=>$info["name"], |
|
41
|
|
|
'site_title'=>config("app.name"), |
|
42
|
|
|
'navigation'=>"DashBoard", |
|
43
|
|
|
'info'=>$info, |
|
44
|
|
|
'userView'=>true, |
|
45
|
|
|
'settingsView' => false, |
|
46
|
|
|
'feed'=>$feed, |
|
47
|
|
|
'extra_info' => $extraInfo, |
|
48
|
|
|
'extraDict' => UserExtra::$extraDict, |
|
49
|
|
|
'socialite_info' => $socialiteInfo, |
|
50
|
|
|
'socialites' => Socialite::getAvailable(), |
|
51
|
|
|
]); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|