Skip to content

Commit eacc1b6

Browse files
authored
Merge pull request #617 from nasirkhan/formatter
Prettier code formatter added
2 parents 5be07ff + 5604b17 commit eacc1b6

File tree

104 files changed

+1868
-1288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1868
-1288
lines changed

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
.env*
4+
vendor/
5+
/vendor
6+
public/
7+
.git
8+
**/.git
9+
package-lock.json
10+
composer.lock

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"printWidth": 120,
3+
"semi": true,
4+
"tabWidth": 4,
5+
"trailingComma": "all",
6+
"plugins": ["@shufo/prettier-plugin-blade", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": ["*.blade.php"],
10+
"options": {
11+
"parser": "blade"
12+
}
13+
}
14+
]
15+
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
@extends('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
8-
{{ __($module_title) }}
9-
</x-backend.breadcrumb-item>
10-
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
11-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
10+
{{ __($module_title) }}
11+
</x-backend.breadcrumb-item>
12+
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
13+
</x-backend.breadcrumbs>
1214
@endsection
1315

1416
@section('content')
15-
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
16-
@endsection
17+
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
18+
@endsection
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
@extends('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
8-
{{ __($module_title) }}
9-
</x-backend.breadcrumb-item>
10-
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
11-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
10+
{{ __($module_title) }}
11+
</x-backend.breadcrumb-item>
12+
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
13+
</x-backend.breadcrumbs>
1214
@endsection
1315

1416
@section('content')
15-
<x-backend.layouts.edit :data="$$module_name_singular" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
16-
@endsection
17+
<x-backend.layouts.edit :data="$$module_name_singular" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon"
18+
:module_action="$module_action" />
19+
@endsection

Modules/Category/Resources/views/backend/categories/form.blade.php

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$field_name = 'name';
66
$field_lable = label_case($field_name);
77
$field_placeholder = $field_lable;
8-
$required = "required";
8+
$required = 'required';
99
?>
1010
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
1111
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -17,7 +17,7 @@
1717
$field_name = 'slug';
1818
$field_lable = label_case($field_name);
1919
$field_placeholder = $field_lable;
20-
$required = "";
20+
$required = '';
2121
?>
2222
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
2323
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -29,7 +29,7 @@
2929
$field_name = 'group_name';
3030
$field_lable = label_case($field_name);
3131
$field_placeholder = $field_lable;
32-
$required = "";
32+
$required = '';
3333
?>
3434
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
3535
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -43,31 +43,34 @@
4343
$field_name = 'image';
4444
$field_lable = label_case($field_name);
4545
$field_placeholder = $field_lable;
46-
$required = "";
46+
$required = '';
4747
?>
4848
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
49-
{{ html()->input("file", $field_name)->class('form-control')->attributes(["$required"]) }}
49+
{{ html()->input('file', $field_name)->class('form-control')->attributes(["$required"]) }}
5050
</div>
5151
</div>
5252

53-
@if($data && $data->getMedia($module_name)->first())
54-
<div class="col-4">
55-
<div class="float-end">
56-
<figure class="figure">
57-
<a href="{{ asset($data->$field_name) }}" data-lightbox="image-set" data-title="Path: {{ asset($data->$field_name) }}">
58-
<img src="{{ asset($data->getMedia($module_name)->first()->getUrl('thumb300')) }}" class="figure-img img-fluid rounded img-thumbnail" alt="">
59-
</a>
60-
<!-- <figcaption class="figure-caption">Path: </figcaption> -->
61-
</figure>
62-
<div class="form-check">
63-
<input class="form-check-input" type="checkbox" value="image_remove" id="image_remove" name="image_remove">
64-
<label class="form-check-label" for="image_remove">
65-
Remove this image
66-
</label>
53+
@if ($data && $data->getMedia($module_name)->first())
54+
<div class="col-4">
55+
<div class="float-end">
56+
<figure class="figure">
57+
<a href="{{ asset($data->$field_name) }}" data-lightbox="image-set"
58+
data-title="Path: {{ asset($data->$field_name) }}">
59+
<img src="{{ asset($data->getMedia($module_name)->first()->getUrl('thumb300')) }}"
60+
class="figure-img img-fluid rounded img-thumbnail" alt="">
61+
</a>
62+
<!-- <figcaption class="figure-caption">Path: </figcaption> -->
63+
</figure>
64+
<div class="form-check">
65+
<input class="form-check-input" type="checkbox" value="image_remove" id="image_remove"
66+
name="image_remove">
67+
<label class="form-check-label" for="image_remove">
68+
Remove this image
69+
</label>
70+
</div>
6771
</div>
6872
</div>
69-
</div>
70-
<x-library.lightbox />
73+
<x-library.lightbox />
7174
@endif
7275
</div>
7376
<div class="row">
@@ -77,7 +80,7 @@
7780
$field_name = 'description';
7881
$field_lable = label_case($field_name);
7982
$field_placeholder = $field_lable;
80-
$required = "";
83+
$required = '';
8184
?>
8285
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
8386
{{ html()->textarea($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -92,7 +95,7 @@
9295
$field_name = 'meta_title';
9396
$field_lable = label_case($field_name);
9497
$field_placeholder = $field_lable;
95-
$required = "";
98+
$required = '';
9699
?>
97100
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
98101
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -104,7 +107,7 @@
104107
$field_name = 'meta_keyword';
105108
$field_lable = label_case($field_name);
106109
$field_placeholder = $field_lable;
107-
$required = "";
110+
$required = '';
108111
?>
109112
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
110113
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -116,7 +119,7 @@
116119
$field_name = 'meta_description';
117120
$field_lable = label_case($field_name);
118121
$field_placeholder = $field_lable;
119-
$required = "";
122+
$required = '';
120123
?>
121124
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
122125
{{ html()->text($field_name)->placeholder($field_placeholder)->class('form-control')->attributes(["$required"]) }}
@@ -130,12 +133,12 @@
130133
<?php
131134
$field_name = 'status';
132135
$field_lable = label_case($field_name);
133-
$field_placeholder = "-- Select an option --";
134-
$required = "required";
136+
$field_placeholder = '-- Select an option --';
137+
$required = 'required';
135138
$select_options = \Modules\Category\Enums\CategoryStatus::toArray();
136139
?>
137140
{{ html()->label($field_lable, $field_name)->class('form-label') }} {!! field_required($required) !!}
138141
{{ html()->select($field_name, $select_options)->class('form-select')->attributes(["$required"]) }}
139142
</div>
140143
</div>
141-
</div>
144+
</div>
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
@extends ('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item type="active" icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
8-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item type="active"
10+
icon='{{ $module_icon }}'>{{ __($module_title) }}</x-backend.breadcrumb-item>
11+
</x-backend.breadcrumbs>
912
@endsection
1013

1114
@section('content')
12-
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
15+
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
1316
@endsection

Modules/Category/Resources/views/frontend/categories/show.blade.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
</p>
2121
</x-frontend.header-block>
2222

23-
24-
2523
<section class="bg-white p-6 text-gray-600 dark:bg-gray-700 dark:text-gray-300 sm:p-20">
2624
<div class="grid grid-cols-1 gap-6 sm:grid-cols-1">
2725
<div class="text-center">

Modules/Post/Resources/views/backend/posts/form.blade.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@
260260
</div>
261261
</div>
262262

263-
264263
@push('after-styles')
265264
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.20/summernote-lite.min.css" rel="stylesheet">
266265
<style>

Modules/Post/Resources/views/backend/posts/trash.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
@endsection
1313

1414
@section('content')
15-
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
16-
@endsection
15+
<x-backend.layouts.trash :data="$$module_name" :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" />
16+
@endsection
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
@extends('backend.layouts.app')
22

3-
@section('title') {{ __($module_action) }} {{ __($module_title) }} @endsection
3+
@section('title')
4+
{{ __($module_action) }} {{ __($module_title) }}
5+
@endsection
46

57
@section('breadcrumbs')
6-
<x-backend.breadcrumbs>
7-
<x-backend.breadcrumb-item route='{{route("backend.$module_name.index")}}' icon='{{ $module_icon }}'>
8-
{{ __($module_title) }}
9-
</x-backend.breadcrumb-item>
10-
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
11-
</x-backend.breadcrumbs>
8+
<x-backend.breadcrumbs>
9+
<x-backend.breadcrumb-item route='{{ route("backend.$module_name.index") }}' icon='{{ $module_icon }}'>
10+
{{ __($module_title) }}
11+
</x-backend.breadcrumb-item>
12+
<x-backend.breadcrumb-item type="active">{{ __($module_action) }}</x-backend.breadcrumb-item>
13+
</x-backend.breadcrumbs>
1214
@endsection
1315

1416
@section('content')
15-
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
16-
@endsection
17+
<x-backend.layouts.create :module_name="$module_name" :module_path="$module_path" :module_title="$module_title" :module_icon="$module_icon" :module_action="$module_action" />
18+
@endsection

0 commit comments

Comments
 (0)