|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* GitScrum v0.1. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Renato Marinho <[email protected]> |
|
6
|
|
|
* @license http://opensource.org/licenses/GPL-3.0 GPLv3 |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace GitScrum\Http\Controllers; |
|
10
|
|
|
|
|
11
|
|
|
use Illuminate\Http\Request; |
|
12
|
|
|
use GitScrum\Models\User; |
|
13
|
|
|
use Auth; |
|
14
|
|
|
|
|
15
|
|
|
class UserController extends Controller |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* Display a listing of the resource. |
|
19
|
|
|
* |
|
20
|
|
|
* @return \Illuminate\Http\Response |
|
21
|
|
|
*/ |
|
22
|
|
|
public function dashboard() |
|
23
|
|
|
{ |
|
24
|
|
|
$user = Auth::user(); |
|
25
|
|
|
$sprints = $user->sprints()->take(2); |
|
26
|
|
|
$sprintColumns = ['tbody_sprintFavorite', |
|
27
|
|
|
'tbody_sprintBacklog', |
|
28
|
|
|
'tbody_sprintProductBacklog', ]; |
|
29
|
|
|
|
|
30
|
|
|
$sprints = $sprints->map(function ($sprint) use ($sprintColumns) { |
|
31
|
|
|
$sprint['column'] = $sprintColumns; |
|
32
|
|
|
|
|
33
|
|
|
return $sprint; |
|
34
|
|
|
}); |
|
35
|
|
|
|
|
36
|
|
|
return view('users.dashboard') |
|
|
|
|
|
|
37
|
|
|
->with('sprints', $sprints) |
|
38
|
|
|
->with('sprintColumns', $sprintColumns) |
|
39
|
|
|
->with('user', $user); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Display a listing of the resource. |
|
44
|
|
|
* |
|
45
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
46
|
|
|
*/ |
|
47
|
|
|
public function index() |
|
48
|
|
|
{ |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Show the form for creating a new resource. |
|
53
|
|
|
* |
|
54
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
55
|
|
|
*/ |
|
56
|
|
|
public function create() |
|
57
|
|
|
{ |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* Store a newly created resource in storage. |
|
62
|
|
|
* |
|
63
|
|
|
* @param \Illuminate\Http\Request $request |
|
64
|
|
|
* |
|
65
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
66
|
|
|
*/ |
|
67
|
|
|
public function store(Request $request) |
|
|
|
|
|
|
68
|
|
|
{ |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* Display the specified resource. |
|
73
|
|
|
* |
|
74
|
|
|
* @param int $id |
|
|
|
|
|
|
75
|
|
|
* |
|
76
|
|
|
* @return \Illuminate\Http\Response |
|
77
|
|
|
*/ |
|
78
|
|
|
public function show($username) |
|
79
|
|
|
{ |
|
80
|
|
|
$user = User::where('username', $username) |
|
81
|
|
|
->where('provider', Auth::user()->provider) |
|
82
|
|
|
->first(); |
|
83
|
|
|
|
|
84
|
|
|
$activities = $user->activities($user->id); |
|
85
|
|
|
|
|
86
|
|
|
return view('users.show') |
|
|
|
|
|
|
87
|
|
|
->with('user', $user) |
|
88
|
|
|
->with('activities', $activities); |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Show the form for editing the specified resource. |
|
93
|
|
|
* |
|
94
|
|
|
* @param int $id |
|
95
|
|
|
* |
|
96
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
97
|
|
|
*/ |
|
98
|
|
|
public function edit($id) |
|
|
|
|
|
|
99
|
|
|
{ |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* Update the specified resource in storage. |
|
104
|
|
|
* |
|
105
|
|
|
* @param \Illuminate\Http\Request $request |
|
106
|
|
|
* @param int $id |
|
107
|
|
|
* |
|
108
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
109
|
|
|
*/ |
|
110
|
|
|
public function update(Request $request, $id) |
|
|
|
|
|
|
111
|
|
|
{ |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* Remove the specified resource from storage. |
|
116
|
|
|
* |
|
117
|
|
|
* @param int $id |
|
118
|
|
|
* |
|
119
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
|
|
|
120
|
|
|
*/ |
|
121
|
|
|
public function destroy($id) |
|
|
|
|
|
|
122
|
|
|
{ |
|
123
|
|
|
} |
|
124
|
|
|
} |
|
125
|
|
|
|
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: