@@ -2,10 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | -use App\User; |
|
| 6 | 5 | use Illuminate\Http\Request; |
| 7 | 6 | use Chrisbjr\ApiGuard\Models\ApiKey; |
| 8 | -use App\Http\Requests; |
|
| 9 | 7 | |
| 10 | 8 | class ApiKeyController extends Controller |
| 11 | 9 | { |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
| 82 | 82 | */ |
| 83 | 83 | public function index() |
| 84 | - { |
|
| 85 | - $data['users'] = User::paginate(15); |
|
| 86 | - return view('users/index', $data); |
|
| 84 | + { |
|
| 85 | + $data['users'] = User::paginate(15); |
|
| 86 | + return view('users/index', $data); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | { |
| 124 | 124 | $id = auth()->user()->id; |
| 125 | 125 | $data['tokens'] = ApiKey::where('user_id', $id)->get(); |
| 126 | - return view('users/profile', $data); |
|
| 126 | + return view('users/profile', $data); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $data2 = []; |
| 150 | 150 | foreach($items as $role) |
| 151 | 151 | { |
| 152 | - $data2[] = [ |
|
| 152 | + $data2[] = [ |
|
| 153 | 153 | 'value' => $role["id"], |
| 154 | 154 | 'text' => $role["name"] |
| 155 | 155 | ]; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function edit($id) |
| 73 | 73 | { |
| 74 | - $data['query'] = User::find($id); |
|
| 74 | + $data[ 'query' ] = User::find($id); |
|
| 75 | 75 | return view('staff.edit', $data); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function index() |
| 84 | 84 | { |
| 85 | - $data['users'] = User::paginate(15); |
|
| 85 | + $data[ 'users' ] = User::paginate(15); |
|
| 86 | 86 | return view('users/index', $data); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | public function profile() |
| 123 | 123 | { |
| 124 | 124 | $id = auth()->user()->id; |
| 125 | - $data['tokens'] = ApiKey::where('user_id', $id)->get(); |
|
| 125 | + $data[ 'tokens' ] = ApiKey::where('user_id', $id)->get(); |
|
| 126 | 126 | return view('users/profile', $data); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function destroy($id) |
| 136 | 136 | { |
| 137 | 137 | $user = User::find($id); |
| 138 | - $user->roles()->sync([]); |
|
| 138 | + $user->roles()->sync([ ]); |
|
| 139 | 139 | |
| 140 | 140 | User::destroy($id); |
| 141 | 141 | session()->flash('message', 'User deleted'); |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | public function get_roles() |
| 147 | 147 | { |
| 148 | 148 | $items = Roles::all(); |
| 149 | - $data2 = []; |
|
| 150 | - foreach($items as $role) |
|
| 149 | + $data2 = [ ]; |
|
| 150 | + foreach ($items as $role) |
|
| 151 | 151 | { |
| 152 | - $data2[] = [ |
|
| 153 | - 'value' => $role["id"], |
|
| 154 | - 'text' => $role["name"] |
|
| 152 | + $data2[ ] = [ |
|
| 153 | + 'value' => $role[ "id" ], |
|
| 154 | + 'text' => $role[ "name" ] |
|
| 155 | 155 | ]; |
| 156 | 156 | |
| 157 | 157 | } |
@@ -4,11 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use App\User; |
| 6 | 6 | use App\Roles; |
| 7 | - |
|
| 8 | 7 | use Chrisbjr\ApiGuard\Models\ApiKey; |
| 9 | -use Illuminate\Http\Request; |
|
| 10 | - |
|
| 11 | -use App\Http\Requests; |
|
| 12 | 8 | use Bouncer; |
| 13 | 9 | |
| 14 | 10 | /** |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use App\Customer; |
| 6 | -use Illuminate\Http\Request; |
|
| 7 | - |
|
| 8 | 6 | use App\Http\Requests; |
| 9 | 7 | |
| 10 | 8 | class CustomersController extends Controller |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | public function updateProfile(Requests\ProfileValidator $input) |
| 30 | 30 | { |
| 31 | 31 | // User information |
| 32 | - User::find(auth()->user()->id)->update($input->except(['_token', 'avatar'])); |
|
| 32 | + User::find(auth()->user()->id)->update($input->except([ '_token', 'avatar' ])); |
|
| 33 | 33 | |
| 34 | 34 | // User image information. |
| 35 | 35 | if (Input::file()) { |
| 36 | 36 | $image = Input::file('avatar'); |
| 37 | - $filename = time() . '.' . $image->getClientOriginalExtension(); |
|
| 38 | - $path = public_path('profilepics/' . $filename); |
|
| 37 | + $filename = time().'.'.$image->getClientOriginalExtension(); |
|
| 38 | + $path = public_path('profilepics/'.$filename); |
|
| 39 | 39 | |
| 40 | 40 | Image::make($image->getRealPath())->resize(80, 80)->save($path); |
| 41 | 41 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function updateSecurity(Requests\PasswordValidation $input) |
| 58 | 58 | { |
| 59 | - $data['password'] = bcrypt($input->password); |
|
| 59 | + $data[ 'password' ] = bcrypt($input->password); |
|
| 60 | 60 | |
| 61 | 61 | User::find(auth()->user()->id)->update($data); |
| 62 | 62 | session()->flash('message', 'Your password has been updated.'); |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function rules() |
| 28 | 28 | { |
| 29 | - return ['password' => 'required|min:6|confirmed']; |
|
| 29 | + return [ 'password' => 'required|min:6|confirmed' ]; |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -19,5 +19,5 @@ |
||
| 19 | 19 | * |
| 20 | 20 | * @var array |
| 21 | 21 | */ |
| 22 | - protected $fillable = ['name']; |
|
| 22 | + protected $fillable = [ 'name' ]; |
|
| 23 | 23 | } |
@@ -16,8 +16,8 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function index() |
| 18 | 18 | { |
| 19 | - $data['roles'] = Roles::all(); |
|
| 20 | - return view('roles.index', $data); |
|
| 19 | + $data['roles'] = Roles::all(); |
|
| 20 | + return view('roles.index', $data); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function index() |
| 17 | 17 | { |
| 18 | - $data['roles'] = Roles::all(); |
|
| 18 | + $data[ 'roles' ] = Roles::all(); |
|
| 19 | 19 | return view('roles.index', $data); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function search(Request $request) |
| 29 | 29 | { |
| 30 | 30 | $term = $request->get('term'); |
| 31 | - $data['roles'] = Roles::where('name', 'LIKE', "$term")->get(); |
|
| 31 | + $data[ 'roles' ] = Roles::where('name', 'LIKE', "$term")->get(); |
|
| 32 | 32 | return view('roles.index', $data); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function show($id) |
| 42 | 42 | { |
| 43 | - $data['query'] = Roles::find($id); |
|
| 43 | + $data[ 'query' ] = Roles::find($id); |
|
| 44 | 44 | return view('', $data); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function edit($id) |
| 73 | 73 | { |
| 74 | - $data['query'] = Roles::find($id); |
|
| 74 | + $data[ 'query' ] = Roles::find($id); |
|
| 75 | 75 | return view('', $data) |
| 76 | 76 | } |
| 77 | 77 | |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace App\Http\Controllers; |
| 4 | 4 | |
| 5 | 5 | use Illuminate\Http\Request; |
| 6 | -use App\Http\Requests; |
|
| 7 | 6 | use Silber\Bouncer\Database\Constraints\Roles; |
| 8 | 7 | |
| 9 | 8 | class RolesController extends Controller |