@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | { |
28 | 28 | $this->middleware(['web']); |
29 | 29 | if (config('ipchecker.settings.auth')) { |
30 | - $this->middleware(['web','auth']); |
|
31 | - $this->middleware(function ($request, $next) { |
|
32 | - if (!empty(config('ipchecker.settings.admin_id'))){ |
|
33 | - if (!in_array(Auth::id(),config('ipchecker.settings.admin_id'))){ |
|
30 | + $this->middleware(['web', 'auth']); |
|
31 | + $this->middleware(function($request, $next) { |
|
32 | + if (!empty(config('ipchecker.settings.admin_id'))) { |
|
33 | + if (!in_array(Auth::id(), config('ipchecker.settings.admin_id'))) { |
|
34 | 34 | return abort(404); |
35 | 35 | } |
36 | 36 | } |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | { |
51 | 51 | $iplist = $ipchecker->getIpList(); |
52 | 52 | |
53 | - if(count($iplist)>0){ |
|
53 | + if (count($iplist)>0) { |
|
54 | 54 | $iplist = $iplist->sortByDesc('created_at'); |
55 | 55 | } |
56 | 56 | |
57 | - return view('ipchecker::index',compact('iplist')); |
|
57 | + return view('ipchecker::index', compact('iplist')); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @param IpCheckerInterface $ipchecker |
63 | 63 | * @return \Illuminate\Http\RedirectResponse |
64 | 64 | */ |
65 | - public function add(Request $request,IpCheckerInterface $ipchecker) |
|
65 | + public function add(Request $request, IpCheckerInterface $ipchecker) |
|
66 | 66 | { |
67 | 67 | $request_data = $request->all(); |
68 | 68 | $request_validation = array( |
@@ -75,17 +75,17 @@ discard block |
||
75 | 75 | return redirect()->back()->withErrors($validator->errors()); |
76 | 76 | } |
77 | 77 | |
78 | - if (!in_array($request->input('ip'),$ipchecker->getIpArray())){ |
|
78 | + if (!in_array($request->input('ip'), $ipchecker->getIpArray())) { |
|
79 | 79 | $ipchecker->saveIp(array( |
80 | 80 | 'group'=>$request->input('group'), |
81 | 81 | 'definition'=>$request->input('definition'), |
82 | 82 | 'ip'=>$request->input('ip'), |
83 | 83 | )); |
84 | 84 | |
85 | - return redirect()->back()->with('success',trans('ipchecker::messages.ip_success')); |
|
85 | + return redirect()->back()->with('success', trans('ipchecker::messages.ip_success')); |
|
86 | 86 | } |
87 | 87 | |
88 | - return redirect()->back()->with('error',trans('ipchecker::messages.ip_error')); |
|
88 | + return redirect()->back()->with('error', trans('ipchecker::messages.ip_error')); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | * @param IpCheckerInterface $ipchecker |
94 | 94 | * @return \Illuminate\Http\RedirectResponse |
95 | 95 | */ |
96 | - public function delete(Request $request,IpCheckerInterface $ipchecker) |
|
96 | + public function delete(Request $request, IpCheckerInterface $ipchecker) |
|
97 | 97 | { |
98 | 98 | $ipchecker->deleteIp($request->input('ipAddress')); |
99 | 99 | |
100 | - return redirect()->back()->with('info',trans('ipchecker::messages.ip_delete')); |
|
100 | + return redirect()->back()->with('info', trans('ipchecker::messages.ip_delete')); |
|
101 | 101 | } |
102 | 102 | } |