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