Completed
Push — master ( a04a71...afa301 )
by Abdelrahman
02:53
created

RolesController::store()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
namespace Rinvex\Fort\Http\Controllers\Backend;
17
18
use Illuminate\Http\Request;
19
use Rinvex\Fort\Models\Role;
20
use Rinvex\Fort\Contracts\RoleRepositoryContract;
21
use Rinvex\Fort\Http\Controllers\AuthorizedController;
22
23
class RolesController extends AuthorizedController
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected $resourceAbilityMap = [
29
        'assign' => 'assign',
30
        'remove' => 'remove',
31
    ];
32
33
    /**
34
     * The role repository instance.
35
     *
36
     * @var \Rinvex\Fort\Contracts\RoleRepositoryContract
37
     */
38
    protected $roleRepository;
39
40
    /**
41
     * Create a new users controller instance.
42
     *
43
     * @param \Rinvex\Fort\Contracts\RoleRepositoryContract $roleRepository
44
     *
45
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
46
     */
47
    public function __construct(RoleRepositoryContract $roleRepository)
48
    {
49
        parent::__construct();
50
51
        $this->authorizeResource(Role::class);
52
53
        $this->roleRepository = $roleRepository;
54
    }
55
56
    /**
57
     * Display a listing of the resource.
58
     *
59
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\View\View|\I...\Contracts\View\Factory?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
60
     */
61
    public function index()
62
    {
63
        $roles = $this->roleRepository->paginate(config('rinvex.fort.backend.items_per_page'));
64
65
        return view('rinvex.fort::backend.roles.index', compact('roles'));
66
    }
67
68
    /**
69
     * Display the specified resource.
70
     *
71
     * @param int $id
72
     *
73
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
74
     */
75
    public function show($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
76
    {
77
        //
78
    }
79
80
    /**
81
     * Bulk control the given resources.
82
     *
83
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
84
     */
85
    public function bulk()
86
    {
87
        //
88
    }
89
90
    /**
91
     * Show the form for creating a new resource.
92
     *
93
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
94
     */
95
    public function create()
96
    {
97
        //
98
    }
99
100
    /**
101
     * Store a newly created resource in storage.
102
     *
103
     * @param \Illuminate\Http\Request $request
104
     *
105
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
106
     */
107
    public function store(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
108
    {
109
        //
110
    }
111
112
    /**
113
     * Show the form for copying the given resource.
114
     *
115
     * @param int $id
116
     *
117
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
118
     */
119
    public function copy($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
120
    {
121
        //
122
    }
123
124
    /**
125
     * Show the form for editing the given resource.
126
     *
127
     * @param int $id
128
     *
129
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
130
     */
131
    public function edit($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
132
    {
133
        //
134
    }
135
136
    /**
137
     * Update the given resource in storage.
138
     *
139
     * @param \Illuminate\Http\Request $request
140
     * @param int                      $id
141
     *
142
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
143
     */
144
    public function update(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
145
    {
146
        //
147
    }
148
149
    /**
150
     * Delete the given resource from storage.
151
     *
152
     * @param int $id
153
     *
154
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
155
     */
156
    public function delete($id)
0 ignored issues
show
Unused Code introduced by
The parameter $id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
157
    {
158
        //
159
    }
160
161
    /**
162
     * Import the given resources into storage.
163
     *
164
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
165
     */
166
    public function import()
167
    {
168
        //
169
    }
170
171
    /**
172
     * Export the given resources from storage.
173
     *
174
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\Http\Response|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
175
     */
176
    public function export()
177
    {
178
        //
179
    }
180
}
181