Completed
Push — 1.1 ( d10fe3...76c5a7 )
by Provinsi
11s
created
src/Http/Controllers/LaravelOpdController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
         $nodes = LaravelOpdModel::get()->toTree();
26 26
         
27
-        $traverse = function ($categories, $prefix = '-') use (&$traverse) {
27
+        $traverse = function($categories, $prefix = '-') use (&$traverse) {
28 28
             foreach ($categories as $category) {
29 29
                 echo $prefix.' '.$category->kunker.' - '.$category->name.'<br>';
30 30
         
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         
35 35
         $traverse($nodes);        
36 36
 
37
-        return view('unit_kerja.index',compact('opds'));
37
+        return view('unit_kerja.index', compact('opds'));
38 38
         
39 39
     }
40 40
 
@@ -48,21 +48,21 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $unit_kerjas = LaravelOpdModel::all();
50 50
 
51
-        return view('unit_kerja.create-child',compact('unit_kerjas'));
51
+        return view('unit_kerja.create-child', compact('unit_kerjas'));
52 52
     }
53 53
 
54 54
     public function addChild($id)
55 55
     {
56
-        $unit_kerja = LaravelOpdModel::where('id',$id)->first();
56
+        $unit_kerja = LaravelOpdModel::where('id', $id)->first();
57 57
 
58
-        return view('unit_kerja.add-child',compact('unit_kerja'));
58
+        return view('unit_kerja.add-child', compact('unit_kerja'));
59 59
     }
60 60
     
61 61
     public function storeRoot(Request $request)
62 62
     {        
63
-        $check_root = LaravelOpdModel::where('id',$request->root);
63
+        $check_root = LaravelOpdModel::where('id', $request->root);
64 64
         
65
-        if($check_root->first()->isEmpty())
65
+        if ($check_root->first()->isEmpty())
66 66
         {                        
67 67
 
68 68
             $unit_kerja = LaravelOpdModel::create([
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     public function storeChild(Request $request)
86 86
     {
87
-        $check_root = LaravelOpdModel::where('id',$request->root);
87
+        $check_root = LaravelOpdModel::where('id', $request->root);
88 88
                           
89 89
             $check_root->first()->children()->create([
90 90
                 'kunker' => $request->c_kunker,
Please login to merge, or discard this patch.
src/LaravelOpd.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
     public function index()
28 28
     {
29
-        return $opds = LaravelOpdModel::orderBy('kunker','asc')->get();                
29
+        return $opds = LaravelOpdModel::orderBy('kunker', 'asc')->get();                
30 30
 
31 31
         //return view('unit_kerja.index',compact('opds'));
32 32
         
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $nodes = LaravelOpdModel::get()->toTree();
38 38
         
39
-        $traverse = function ($categories, $prefix = '-') use (&$traverse) {
39
+        $traverse = function($categories, $prefix = '-') use (&$traverse) {
40 40
             foreach ($categories as $category) {
41 41
                 echo $prefix.' '.$category->kunker.' - '.$category->name.' - ['.$category->npej.']<br>';
42 42
         
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 
63 63
     public function addChild($id)
64 64
     {
65
-        return $unit_kerja = LaravelOpdModel::where('id',$id)->first();
65
+        return $unit_kerja = LaravelOpdModel::where('id', $id)->first();
66 66
 
67 67
         //return view('unit_kerja.add-child',compact('unit_kerja'));
68 68
     }
69 69
     
70 70
     public function storeRoot($request = array())
71 71
     {        
72
-        $check_root = LaravelOpdModel::where('id',$request->root);
72
+        $check_root = LaravelOpdModel::where('id', $request->root);
73 73
         
74
-        if($check_root->first()->isEmpty())
74
+        if ($check_root->first()->isEmpty())
75 75
         {                        
76 76
 
77 77
             $unit_kerja = LaravelOpdModel::create([
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     public function storeChild($request = array())
98 98
     {
99
-        $check_root = LaravelOpdModel::where('id',$request->root);
99
+        $check_root = LaravelOpdModel::where('id', $request->root);
100 100
                           
101 101
             $check_root->first()->children()->create([
102 102
                 'kunker' => $request->c_kunker,
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,8 +83,7 @@
 block discarded – undo
83 83
                 'npej' => $request->npej,
84 84
                 'njab' => $request->njab
85 85
             ]);
86
-        }
87
-        else
86
+        } else
88 87
         {
89 88
             return redirect()->back();
90 89
         }
Please login to merge, or discard this patch.
src/Models/LaravelOpdModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     use Uuids;
19 19
 
20 20
     protected $table = "opd";
21
-    protected $fillable = ['kunker','name','kunker_sinjab','kunker_simral','levelunker','njab','npej'];
21
+    protected $fillable = ['kunker', 'name', 'kunker_sinjab', 'kunker_simral', 'levelunker', 'njab', 'npej'];
22 22
     protected $hidden = [];
23 23
     public $incrementing = false;
24 24
 }
Please login to merge, or discard this patch.
src/database/migrations/2017_11_08_053023_create_laravel_opd_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
      */
15 15
     public function up()
16 16
     {
17
-        Schema::create('opd', function (Blueprint $table) {
17
+        Schema::create('opd', function(Blueprint $table) {
18 18
             //$table->increments('id');
19 19
             $table->uuid('id')->unique();
20 20
             $table->primary('id');
Please login to merge, or discard this patch.