Skip to content

Commit 7168b07

Browse files
abbasajorlou1371theAwmin
authored andcommitted
chore: upgrade Livewire to v4.0, add Spatie Laravel Permission package, and refactor Livewire configuration
1 parent d961426 commit 7168b07

10 files changed

Lines changed: 596 additions & 437 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
"laravel/framework": "^12.0",
1111
"laravel/sanctum": "^4.0",
1212
"laravel/tinker": "^2.8",
13-
"livewire/livewire": "^3.1",
13+
"livewire/livewire": "^4.0",
1414
"maatwebsite/excel": "^3.1",
1515
"morilog/jalali": "3.*",
1616
"pion/laravel-chunk-upload": "^1.5",
1717
"pishran/zarinpal": "^4.3",
1818
"predis/predis": "^2.2",
1919
"sadegh19b/laravel-persian-validation": "^1.4",
20+
"spatie/laravel-permission": "^6.24",
2021
"spatie/laravel-sitemap": "^7.0",
2122
"staudenmeir/eloquent-has-many-deep": "^1.7",
2223
"ybazli/faker": "^1.0"

composer.lock

Lines changed: 90 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/livewire.php

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,96 @@
3030

3131
/*
3232
|---------------------------------------------------------------------------
33-
| Layout
33+
| Component Layout
3434
|---------------------------------------------------------------------------
3535
| The view that will be used as the layout when rendering a single component
36-
| as an entire page via `Route::get('/post/create', CreatePost::class);`.
36+
| as an entire page via `Route::livewire('/post/create', CreatePost::class);`.
3737
| In this case, the view returned by CreatePost will render into $slot.
3838
|
3939
*/
4040

41-
'layout' => 'components.layouts.app',
41+
'component_layout' => 'components.layouts.app',
4242

4343
/*
4444
|---------------------------------------------------------------------------
45-
| Lazy Loading Placeholder
45+
| Component Placeholder
4646
|---------------------------------------------------------------------------
4747
| Livewire allows you to lazy load components that would otherwise slow down
4848
| the initial page load. Every component can have a custom placeholder or
4949
| you can define the default placeholder view for all components below.
5050
|
5151
*/
5252

53-
'lazy_placeholder' => null,
53+
'component_placeholder' => null,
54+
55+
/*
56+
|---------------------------------------------------------------------------
57+
| Component Locations
58+
|---------------------------------------------------------------------------
59+
| Defines where Livewire looks for single-file and multi-file (view-based)
60+
| components. This allows you to organize your components in different
61+
| directories while maintaining Livewire's auto-discovery features.
62+
|
63+
*/
64+
65+
'component_locations' => [
66+
resource_path('views/components'),
67+
resource_path('views/livewire'),
68+
],
69+
70+
/*
71+
|---------------------------------------------------------------------------
72+
| Component Namespaces
73+
|---------------------------------------------------------------------------
74+
| Creates custom namespaces for organizing view-based components.
75+
| For example, 'layouts' => resource_path('views/layouts') allows you to
76+
| use <livewire:layouts::app /> for views/layouts/app.blade.php.
77+
|
78+
*/
79+
80+
'component_namespaces' => [
81+
'layouts' => resource_path('views/layouts'),
82+
'pages' => resource_path('views/pages'),
83+
],
84+
85+
/*
86+
|---------------------------------------------------------------------------
87+
| Make Command Defaults
88+
|---------------------------------------------------------------------------
89+
| Configure default component format and emoji usage when generating
90+
| new components with php artisan make:livewire command.
91+
| Options: 'sfc' (single-file), 'mfc' (multi-file), or 'class'.
92+
|
93+
*/
94+
95+
'make_command' => [
96+
'type' => 'class', // Using 'class' to match v3 behavior
97+
'emoji' => false, // Set to false to avoid emoji prefixes
98+
],
99+
100+
/*
101+
|---------------------------------------------------------------------------
102+
| Smart wire:key Behavior
103+
|---------------------------------------------------------------------------
104+
| Helps prevent wire:key issues on deeply nested components. When enabled,
105+
| Livewire automatically generates smarter keys for nested components.
106+
| Note: You still need to add wire:key manually in loops.
107+
|
108+
*/
109+
110+
'smart_wire_keys' => true,
111+
112+
/*
113+
|---------------------------------------------------------------------------
114+
| CSP-Safe Mode
115+
|---------------------------------------------------------------------------
116+
| Enable Content Security Policy mode to avoid unsafe-eval violations.
117+
| When enabled, Livewire uses the Alpine CSP build. Note: This mode
118+
| restricts complex JavaScript expressions in directives.
119+
|
120+
*/
121+
122+
'csp_safe' => false,
54123

55124
/*
56125
|---------------------------------------------------------------------------

resources/views/components/alert.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
{{ $message }}
66
</div>
77
</div>
8-
</main>
8+
</main>

resources/views/components/layouts/app.blade.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
<meta property="og:url" content="{{ url()->current() }}">
1919
<meta property="og:site_name" content="سه بعدی متا">
2020
<meta property="og:locale" content="fa_IR">
21-
21+
2222
@if (View::getSection('extera-schema'))
2323
@yield('extera-schema')
2424
@endif
2525
<script type="application/ld+json">
2626
{
27-
"@context": "https://schema.org",
28-
"@graph": [
27+
"@@context": "https://schema.org",
28+
"@@graph": [
2929
{
30-
"@type": "Organization",
30+
"@@type": "Organization",
3131
"name": "سه بعدی متا",
3232
"alternateName": "3D Meta",
3333
"url": "{{ url()->current() }}",
@@ -38,7 +38,7 @@
3838
"telephone": "09127855049",
3939
"inLanguage": "fa",
4040
"address": {
41-
"@type": "PostalAddress",
41+
"@@type": "PostalAddress",
4242
"addressCountry": "ایران",
4343
"addressLocality": "قزوین",
4444
"addressRegion": "استان قزوین",
@@ -52,7 +52,7 @@
5252
]
5353
},
5454
{
55-
"@type": "WebSite",
55+
"@@type": "WebSite",
5656
"name": "@yield('title', 'سه بعدی متا | ' . ($title ?? config('app.name')))",
5757
"alternateName": "3D Meta",
5858
"url": "{{ url()->current() }}",
@@ -62,21 +62,21 @@
6262
"keywords": "@yield('keywords', '3d,3dmeta,3drgb,سبعدی,سه بعدی,محصولات سه بعدی,فایل سه بعدی,خرید فایل سبعدی,icon,آیکون,آیکون سه بعدی,خرید آیکون سه بعدی,انیمیشن')",
6363
"inLanguage": "fa",
6464
"potentialAction": {
65-
"@type": "SearchAction",
65+
"@@type": "SearchAction",
6666
"target": "{{ url()->current() }}?q={search_term_string}",
6767
"query-input": "required name=search_term_string"
6868
}
6969
},
7070
{
71-
"@type": "Store",
71+
"@@type": "Store",
7272
"name": "سه بعدی متا",
7373
"alternateName": "3D Meta",
7474
"url": "{{ url()->current() }}",
7575
"image": "@yield('og:image', asset('home-page/images/3d.png'))",
7676
"logo": "{{ asset('home-page/images/3d.png') }}",
7777
"description": "@yield('description', 'سامانه سه‌بعدی متا با تعرفه‌ای ثابت مرکز عرضه جدیدترین مدل سه‌بعدی، آیکون، انیمیشن و دیگر فایل‌های طراحی می‌باشد.')",
7878
"address": {
79-
"@type": "PostalAddress",
79+
"@@type": "PostalAddress",
8080
"addressCountry": "ایران",
8181
"addressLocality": "قزوین",
8282
"addressRegion": "استان قزوین",
@@ -844,9 +844,6 @@ class="disable-dark-mode2 hidden bg-[#FCFCFC] dark:bg-transparent dark:flex ju
844844
<!-- end nav -->
845845
<div class="w-full main-content-smallNav ">
846846
{{ $slot }}
847-
848-
849-
850847
<footer class="px-5 lg:px-9 3xl:px-0 w-full max-w-[1500px] mx-auto mt-32">
851848
<div
852849
class="flex-wrap flex justify-between items-ctener gap-1 md:gap-2 mx-auto w-full bg-white dark:bg-[#1A1A18] p-3 mb-10 rounded-2xl">

resources/views/livewire/about-us.blade.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
@section('extera-schema')
88
<script type="application/ld+json">
99
{
10-
"@context": "https://schema.org",
11-
"@type": "AboutPage",
10+
"@@context": "https://schema.org",
11+
"@@type": "AboutPage",
1212
"name": "About Us - سه بعدی متا فروشگاه",
1313
"url": "{{ url()->current() }}",
1414
"mainEntity": {
15-
"@type": "Organization",
15+
"@@type": "Organization",
1616
"name": "سه بعدی متا فروشگاه",
1717
"url": "{{ url('/') }}",
1818
"logo": "{{ asset('home-page/images/3d.png') }}",
@@ -23,20 +23,20 @@
2323
"https://pin.it/7C5mYf6Q6"
2424
],
2525
"contactPoint": {
26-
"@type": "ContactPoint",
26+
"@@type": "ContactPoint",
2727
"telephone": "+989127855049",
2828
"contactType": "Customer Service",
2929
"areaServed": "IR",
3030
"availableLanguage": "Persian"
3131
},
3232
"description": "سه بعدی متا فروشگاه پیشرو در زمینه چاپ سه بعدی است که خدمات حرفه‌ای و محصولات با کیفیت بالا ارائه می‌دهد.",
3333
"parentOrganization": {
34-
"@type": "Organization",
34+
"@@type": "Organization",
3535
"name": "هولدینگ زنجیره تامین بهشت"
3636
},
3737
"foundingDate": "2020",
3838
"address": {
39-
"@type": "PostalAddress",
39+
"@@type": "PostalAddress",
4040
"addressCountry": "Iran",
4141
"addressLocality": "Qazvin",
4242
"addressRegion": "Qazvin Province",
@@ -45,7 +45,7 @@
4545
}
4646
}
4747
</script>
48-
48+
4949
@endsection
5050

5151
<div>

0 commit comments

Comments
 (0)