Passed
Push — master ( d58bf8...6af014 )
by Faiq
04:49
created
app/Thread.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 
7
-class Thread extends Model
8
-{
7
+class Thread extends Model {
9 8
     protected $table = 'threads';
10 9
 
11 10
     protected $dates = [
@@ -13,19 +12,23 @@  discard block
 block discarded – undo
13 12
         'updated_at'
14 13
     ];
15 14
 
16
-    public function topic() {
15
+    public function topic()
16
+    {
17 17
         return $this->belongsTo('App\ThreadTopic', 'id_topic');
18 18
     }
19 19
 
20
-    public function user() {
20
+    public function user()
21
+    {
21 22
         return $this->belongsTo('App\User');
22 23
     }
23 24
 
24
-    public function doctor() {
25
+    public function doctor()
26
+    {
25 27
         return $this->belongsTo('App\Doctor');
26 28
     }
27 29
 
28
-    public function trimStr(string $string) {
30
+    public function trimStr(string $string)
31
+    {
29 32
         if(strlen($string) > 200) {
30 33
             return substr($string, 0, 200).'...';
31 34
         }
Please login to merge, or discard this patch.
app/Http/Controllers/ThreadAskController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
 use App\Thread;
8 8
 use App\ThreadTopic;
9 9
 
10
-class ThreadAskController extends Controller
11
-{
10
+class ThreadAskController extends Controller {
12 11
     public function __construct()
13 12
     {
14 13
         $this->middleware('auth', ['except' => [
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
@@ -6,8 +6,7 @@
 block discarded – undo
6 6
 use App\ThreadTopic;
7 7
 use Illuminate\Support\Facades\Auth;
8 8
 
9
-class ThreadController extends Controller
10
-{
9
+class ThreadController extends Controller {
11 10
     public function __construct()
12 11
     {
13 12
         $this->middleware('auth:admin', ['except' => [
Please login to merge, or discard this patch.
app/Http/Controllers/ThreadAnswerController.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 ThreadAnswerController extends Controller
10
-{
9
+class ThreadAnswerController extends Controller {
11 10
     public function __construct()
12 11
     {
13 12
         $this->middleware('auth:doctor');
Please login to merge, or discard this patch.
app/Log.php 1 patch
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 
7
-class Log extends Model
8
-{
7
+class Log extends Model {
9 8
     /**
10 9
      * @var string
11 10
      */
@@ -32,35 +31,40 @@  discard block
 block discarded – undo
32 31
     /**
33 32
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
34 33
      */
35
-    public function thread() {
34
+    public function thread()
35
+    {
36 36
         return $this->belongsTo('App\Thread', 'thread_id');
37 37
     }
38 38
 
39 39
     /**
40 40
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
41 41
      */
42
-    public function article() {
42
+    public function article()
43
+    {
43 44
         return $this->belongsTo('App\Articles', 'article_id');
44 45
     }
45 46
 
46 47
     /**
47 48
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
48 49
      */
49
-    public function admin() {
50
+    public function admin()
51
+    {
50 52
         return $this->belongsTo('App\Admin', 'admin_id');
51 53
     }
52 54
 
53 55
     /**
54 56
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
55 57
      */
56
-    public function doctor() {
58
+    public function doctor()
59
+    {
57 60
         return $this->belongsTo('App\Doctor', 'doctor_id');
58 61
     }
59 62
 
60 63
     /**
61 64
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
62 65
      */
63
-    public function member() {
66
+    public function member()
67
+    {
64 68
         return $this->belongsTo('App\User', 'user_id');
65 69
     }
66 70
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ArticleController.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
 use Illuminate\Support\Facades\Auth;
9 9
 use App\Articles;
10 10
 
11
-class ArticleController extends Controller
12
-{
11
+class ArticleController extends Controller {
13 12
     /**
14 13
      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
15 14
      */
@@ -45,13 +44,13 @@  discard block
 block discarded – undo
45 44
             'cover_image' => 'image|nullable|max:3999'
46 45
         ]);
47 46
 
48
-        if($request->hasFile('cover_image')){
47
+        if($request->hasFile('cover_image')) {
49 48
             $filenameWithExt = $request->file('cover_image')->getClientOriginalName();
50 49
             $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
51 50
             $extension = $request->file('cover_image')->getClientOriginalExtension();
52 51
             $fileNameToStore = $filename.'_'.time().'.'.$extension;
53 52
             $path = $request->file('cover_image')->storeAs('public/cover_images', $fileNameToStore);
54
-        }else {
53
+        } else {
55 54
             $fileNameToStore = 'noimage.jpg';
56 55
         }
57 56
 
@@ -237,7 +236,7 @@  discard block
 block discarded – undo
237 236
 
238 237
         ]);
239 238
 
240
-        if($request->hasFile('cover_image')){
239
+        if($request->hasFile('cover_image')) {
241 240
             $filenameWithExt = $request->file('cover_image')->getClientOriginalName();
242 241
             $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
243 242
             $extension = $request->file('cover_image')->getClientOriginalExtension();
@@ -249,7 +248,7 @@  discard block
 block discarded – undo
249 248
         $article->category = $request->input('category');
250 249
         $article->title = $request->input('title');
251 250
         $article->content = $request->input('content');
252
-        if($request->hasFile('cover_image')){
251
+        if($request->hasFile('cover_image')) {
253 252
             $article->cover_image = $fileNameToStore;
254 253
         }
255 254
 
@@ -268,7 +267,7 @@  discard block
 block discarded – undo
268 267
     {
269 268
         $article = Articles::find($id);
270 269
 
271
-        if($article->cover_image != 'noimage.jpg'){
270
+        if($article->cover_image != 'noimage.jpg') {
272 271
             Storage::delete('public/cover_images/'.$article->cover_image);
273 272
         }
274 273
 
@@ -284,7 +283,8 @@  discard block
 block discarded – undo
284 283
      *
285 284
      * @return mixed
286 285
      */
287
-    private function currentUser() {
286
+    private function currentUser()
287
+    {
288 288
         return Auth::guard(session('guard'))->user();
289 289
     }
290 290
 }
Please login to merge, or discard this patch.
app/Common.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\Support\Facades\Auth;
6 6
 
7
-class Common
8
-{
7
+class Common {
9 8
 
10 9
     /**
11 10
      * Register new activity log
Please login to merge, or discard this patch.
app/Http/Controllers/HospitalController.php 1 patch
Braces   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
 use App\Hospital;
9 9
 use App\City;
10 10
 
11
-class HospitalController extends Controller
12
-{
11
+class HospitalController extends Controller {
13 12
     /**
14 13
      * Display a listing of the resource.
15 14
      *
@@ -154,7 +153,7 @@  discard block
 block discarded – undo
154 153
         $hospital = Hospital::find($id);
155 154
         $delrooms = $this->deleteRoomsAndRoomDetail($id);
156 155
 
157
-        if($delrooms){
156
+        if($delrooms) {
158 157
             if($hospital->delete()) {
159 158
                 return redirect(route('hospital.index'))->with('success', 'Rumah sakit dihapus !');
160 159
             }
@@ -220,11 +219,11 @@  discard block
 block discarded – undo
220 219
 
221 220
     public function searchHospital(Request $request)
222 221
     {
223
-        if($request->nama == null AND $request->location != null){
222
+        if($request->nama == null AND $request->location != null) {
224 223
             $hospital = Hospital::where('city_id',$request->location)->orderBy('name','asc')->paginate(5);
225
-        }elseif ($request->location == null AND $request->nama != null){
224
+        } elseif ($request->location == null AND $request->nama != null) {
226 225
             $hospital = Hospital::where('biography','LIKE','%'.$request->nama.'%')->orderBy('name','asc')->paginate(5);
227
-        }else{
226
+        } else {
228 227
             $hospital = Hospital::where('biography','LIKE','%'.$request->nama.'%')->where('city_id',$request->location)->orderBy('name','asc')->paginate(5);
229 228
         }
230 229
         $location = City::orderBy('name','asc')->pluck('name','id');
Please login to merge, or discard this patch.
app/Doctor.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
 use Illuminate\Contracts\Auth\MustVerifyEmail;
10 10
 use Illuminate\Foundation\Auth\User as Authenticatable;
11 11
 
12
-class Doctor extends Authenticatable
13
-{
12
+class Doctor extends Authenticatable {
14 13
     use Notifiable;
15 14
 
16 15
     protected $guard = 'doctor';
@@ -72,15 +71,18 @@  discard block
 block discarded – undo
72 71
         return $this->belongsTo('App\DoctorSpecialization', 'specialization_id');
73 72
     }
74 73
 
75
-    public function city() {
74
+    public function city()
75
+    {
76 76
         return $this->belongsTo('App\City', 'city_id');
77 77
     }
78 78
 
79
-    public function thread() {
79
+    public function thread()
80
+    {
80 81
         return $this->hasMany('App\Thread', 'doctor_id');
81 82
     }
82 83
 
83
-    public function hospital() {
84
+    public function hospital()
85
+    {
84 86
         return $this->belongsToMany('App\Hospital', 'doctor_details', 'doctor_id', 'hospital_id');
85 87
     }
86 88
 
Please login to merge, or discard this patch.