This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
10
{
11
use HandlesAuthorization;
12
13
/**
14
* Determine whether the user can view the location.
15
*
16
* @param \App\User $user
17
* @return mixed
18
*/
19
public function index(User $user)
20
{
21
return $user->isManager();
22
}
23
24
/**
25
* Determine whether the user can view the create location page.
26
*
27
* @param \App\User $user
28
* @return mixed
29
*/
30
public function create(User $user)
31
{
32
return $user->isManager();
33
}
34
35
/**
36
* Determine whether the user can create a location.
37
*
38
* @param \App\User $user
39
* @return boolean
40
*/
41
public function store(User $user)
42
{
43
return $user->isManager();
44
}
45
46
/**
47
* Determine whether the user can view a location.
48
*
49
* @param \App\User $user
50
* @return mixed
51
*/
52
public function show(User $user)
53
{
54
return $user->isUser();
55
}
56
57
/**
58
* Determine whether the user can view the edit page for a location.
59
*
60
* @param \App\User $user
61
* @return mixed
62
*/
63
public function edit(User $user)
64
{
65
return $user->isManager();
66
}
67
68
/**
69
* Determine whether the user can update the location.
70
*
71
* @param \App\User $user
72
* @return mixed
73
*/
74
public function update(User $user)
75
{
76
return $user->isManager();
77
}
78
79
/**
80
* Determine whether the user can delete the location.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.