Passed
Pull Request — master (#38)
by Faiq
05:08
created
app/Http/Middleware/VerifyCsrfToken.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
6 6
 
7
-class VerifyCsrfToken extends Middleware
8
-{
7
+class VerifyCsrfToken extends Middleware {
9 8
     /**
10 9
      * Indicates whether the XSRF-TOKEN cookie should be set on the response.
11 10
      *
Please login to merge, or discard this patch.
app/Http/Middleware/TrimStrings.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
6 6
 
7
-class TrimStrings extends Middleware
8
-{
7
+class TrimStrings extends Middleware {
9 8
     /**
10 9
      * The names of the attributes that should not be trimmed.
11 10
      *
Please login to merge, or discard this patch.
app/Http/Controllers/ThreadController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Http\Request;
6 6
 
7
-class ThreadController extends Controller
8
-{
7
+class ThreadController extends Controller {
9 8
     /**
10 9
      * Display a listing of the resource.
11 10
      *
Please login to merge, or discard this patch.
app/Http/Controllers/ArticleController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@
 block discarded – undo
9 9
 use App\Admin;
10 10
 use App\Doctor;
11 11
 
12
-class ArticleController extends Controller
13
-{
12
+class ArticleController extends Controller {
14 13
     /**
15 14
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
16 15
      */
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function index()
18 18
     {
19
-        $articles = Articles::orderBy('category','asc')->paginate(5);
19
+        $articles = Articles::orderBy('category', 'asc')->paginate(5);
20 20
         $data = [
21 21
             'articles' => $articles
22 22
         ];
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function store(Request $request)
41 41
     {
42
-        $this->validate($request,[
42
+        $this->validate($request, [
43 43
             'category' => 'required',
44 44
             'title' => 'required',
45 45
             'content' => 'required|min:500',
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         $article->category = $request->input('category');
50 50
         $article->title = $request->input('title');
51 51
         $article->content = $request->input('content');
52
-        if(session('guard') == 'admin') {
52
+        if (session('guard') == 'admin') {
53 53
             $article->admin_id = Auth::guard('admin')->user()->id;
54 54
         } else {
55 55
             $article->doctor_id = Auth::guard('doctor')->user()->id;
56 56
         }
57 57
 
58
-        if($article->save()) {
59
-            return redirect (route('article.index'))->with('success', 'Artikel baru berhasil ditambahkan !');
58
+        if ($article->save()) {
59
+            return redirect(route('article.index'))->with('success', 'Artikel baru berhasil ditambahkan !');
60 60
         }
61 61
 
62 62
         return redirect(route('article.create'))->with('failed', 'Gagal menambahkan artikel.');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         }
100 100
 
101 101
         $data = [
102
-            'articles' => Articles::where('category', $cat)->orderBy('title','asc')->get(),
102
+            'articles' => Articles::where('category', $cat)->orderBy('title', 'asc')->get(),
103 103
             'category' => $category,
104 104
             'cat' => $cat
105 105
         ];
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
         }
131 131
             $data = [
132 132
                 'articles' => Articles::where('category', $cat)
133
-                                        ->where('title','LIKE',$name.'%')
134
-                                        ->orderBy('title','asc')
133
+                                        ->where('title', 'LIKE', $name.'%')
134
+                                        ->orderBy('title', 'asc')
135 135
                                         ->get(),
136 136
                 'category' => $category,
137 137
                 'cat' => $cat
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $cari = $request->cari;
146 146
         $articles = Articles::where('category', $cat)
147
-                        ->where('content','LIKE','%'.$cari.'%')
148
-                        ->orderBy('title','asc')
147
+                        ->where('content', 'LIKE', '%'.$cari.'%')
148
+                        ->orderBy('title', 'asc')
149 149
                         ->get();
150 150
         $category = null;
151 151
         switch ($cat) {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function update(Request $request, $id)
197 197
     {
198
-        $this->validate($request,[
198
+        $this->validate($request, [
199 199
             'category' => 'required',
200 200
             'title' => 'required',
201 201
             'content' => 'required|min:500',
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
         $article->title = $request->input('title');
207 207
         $article->content = $request->input('content');
208 208
 
209
-        if($article->save()) {
210
-            return redirect (route('article.index'))->with('success', 'Artikel berhasil diubah !');
209
+        if ($article->save()) {
210
+            return redirect(route('article.index'))->with('success', 'Artikel berhasil diubah !');
211 211
         }
212 212
 
213
-        return redirect (route('article.edit', $id))->with('failed', 'Gagal mengubah artikel !');
213
+        return redirect(route('article.edit', $id))->with('failed', 'Gagal mengubah artikel !');
214 214
     }
215 215
 
216 216
     /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     {
222 222
         $article = Articles::find($id);
223 223
 
224
-        if($article->delete()) {
224
+        if ($article->delete()) {
225 225
             return redirect()->back()->with('success', 'Artikel dihapus !');
226 226
         }
227 227
 
Please login to merge, or discard this patch.
app/Http/Controllers/Controller.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,6 @@
 block discarded – undo
7 7
 use Illuminate\Foundation\Validation\ValidatesRequests;
8 8
 use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
9 9
 
10
-class Controller extends BaseController
11
-{
10
+class Controller extends BaseController {
12 11
     use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
13 12
 }
Please login to merge, or discard this patch.
app/Http/Controllers/DocController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
6 6
 use Illuminate\Http\Request;
7 7
 use Illuminate\Support\Facades\Auth;
8 8
 
9
-class DocController extends Controller
10
-{
9
+class DocController extends Controller {
11 10
     /**
12 11
      * DocController constructor.
13 12
      */
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/VerificationController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
 use App\Http\Controllers\Controller;
6 6
 use Illuminate\Foundation\Auth\VerifiesEmails;
7 7
 
8
-class VerificationController extends Controller
9
-{
8
+class VerificationController extends Controller {
10 9
     /*
11 10
     |--------------------------------------------------------------------------
12 11
     | Email Verification Controller
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
 use App\Http\Controllers\Controller;
6 6
 use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7 7
 
8
-class ForgotPasswordController extends Controller
9
-{
8
+class ForgotPasswordController extends Controller {
10 9
     /*
11 10
     |--------------------------------------------------------------------------
12 11
     | Password Reset Controller
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
 use App\Http\Controllers\Controller;
6 6
 use Illuminate\Foundation\Auth\AuthenticatesUsers;
7 7
 
8
-class LoginController extends Controller
9
-{
8
+class LoginController extends Controller {
10 9
     /*
11 10
     |--------------------------------------------------------------------------
12 11
     | Login Controller
Please login to merge, or discard this patch.