From bbca2e8a70d32eb8857748d3f54efa9b13e2ef49 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Mon, 12 Jun 2023 09:45:42 +0330 Subject: [PATCH] optimized blades optimized product factory --- database/factories/ProductFactory.php | 2 +- package.json | 1 - resources/views/payment/result.blade.php | 2 +- resources/views/website/card.blade.php | 2 +- resources/views/website/cat.blade.php | 6 +- resources/views/website/compare.blade.php | 2 +- .../views/website/component/footer.blade.php | 94 ++++++++++++++ .../header.blade.php} | 122 +----------------- .../{pro.blade.php => product-box.blade.php} | 0 resources/views/website/contact.blade.php | 2 +- resources/views/website/customer.blade.php | 4 +- resources/views/website/index.blade.php | 2 +- resources/views/website/invoice.blade.php | 2 +- .../views/website/layout/layout.blade.php | 9 ++ .../website/{ => layout}/sidebar.blade.php | 0 resources/views/website/post.blade.php | 2 +- resources/views/website/posts.blade.php | 2 +- resources/views/website/product.blade.php | 4 +- resources/views/website/products.blade.php | 6 +- resources/views/website/sign.blade.php | 2 +- resources/views/website/signsms.blade.php | 2 +- resources/views/website/ticket.blade.php | 2 +- resources/views/website/track.blade.php | 2 +- 23 files changed, 132 insertions(+), 140 deletions(-) create mode 100644 resources/views/website/component/footer.blade.php rename resources/views/website/{layout.blade.php => component/header.blade.php} (53%) mode change 100755 => 100644 rename resources/views/website/component/{pro.blade.php => product-box.blade.php} (100%) create mode 100755 resources/views/website/layout/layout.blade.php rename resources/views/website/{ => layout}/sidebar.blade.php (100%) diff --git a/database/factories/ProductFactory.php b/database/factories/ProductFactory.php index 0be830d..fd5a933 100755 --- a/database/factories/ProductFactory.php +++ b/database/factories/ProductFactory.php @@ -19,7 +19,7 @@ class ProductFactory extends Factory { $rand = rand(1,2); - $title = ($rand == 1?'موبایل':'تبلت').' ' . $this->faker->unique()->realText(50); + $title = ($rand == 1?'موبایل':'تبلت').' ' . $this->faker->unique()->firstNameFemale; return [ // 'name' => $title, diff --git a/package.json b/package.json index e3e80e6..4a86d3c 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "persian-datepicker": "^1.2.0", "alertifyjs": "^1.13.1", "chart.js": "^3.8.2", - "hc-offcanvas-nav": "^6.1.5", "x-mega-menu": "^1.2.0", "xzoom": "^1.0.15" }, diff --git a/resources/views/payment/result.blade.php b/resources/views/payment/result.blade.php index 8fbf28e..21edf6b 100755 --- a/resources/views/payment/result.blade.php +++ b/resources/views/payment/result.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('content')
diff --git a/resources/views/website/card.blade.php b/resources/views/website/card.blade.php index cbf272d..b9ca9c6 100755 --- a/resources/views/website/card.blade.php +++ b/resources/views/website/card.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Shopping card")}} - @endsection diff --git a/resources/views/website/cat.blade.php b/resources/views/website/cat.blade.php index 0a0fee1..6360935 100755 --- a/resources/views/website/cat.blade.php +++ b/resources/views/website/cat.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{$cat->name}} - @endsection @@ -42,7 +42,7 @@ @endif > - @include('website.sidebar') + @include('website.layout.sidebar')
@@ -50,7 +50,7 @@
@foreach($products as $pro)
- @include('website.component.pro',['p' => $pro]) + @include('website.component.product-box',['p' => $pro])
@endforeach
diff --git a/resources/views/website/compare.blade.php b/resources/views/website/compare.blade.php index 2427e81..82ded23 100755 --- a/resources/views/website/compare.blade.php +++ b/resources/views/website/compare.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Compare products")}} - @endsection diff --git a/resources/views/website/component/footer.blade.php b/resources/views/website/component/footer.blade.php new file mode 100644 index 0000000..02b5ea1 --- /dev/null +++ b/resources/views/website/component/footer.blade.php @@ -0,0 +1,94 @@ + + + +@yield('js-content') + +@include('component.lang') + + diff --git a/resources/views/website/layout.blade.php b/resources/views/website/component/header.blade.php old mode 100755 new mode 100644 similarity index 53% rename from resources/views/website/layout.blade.php rename to resources/views/website/component/header.blade.php index 7738d87..3f5fee6 --- a/resources/views/website/layout.blade.php +++ b/resources/views/website/component/header.blade.php @@ -1,5 +1,5 @@ - + {!! \App\Helpers\remTitle( SEO::generate()) !!} - - @yield('title') - {{config('app.name')}} - + + @yield('title') + {{config('app.name')}} + @@ -106,7 +106,7 @@ data-ajax="{{route('search.ajax')}}" class="form-control" placeholder="جستجو در محصولات..." aria-label="search" aria-describedby="addon-wrapping"> - + @@ -141,113 +141,3 @@ @include('website.component.navbar') - -
-
- @yield('content') -
-
- -{{----}} -
-
-
-
-

- {{\App\Helpers\getSettingCategory('footer1')->name}} -

-
    - @foreach(\App\Helpers\getSettingCategory('footer1')->posts as $p) -
  • - - {{$p->title}} - -
  • - @endforeach -
-
-
-

- {{\App\Helpers\getSettingCategory('footer2')->name}} -

-
    - @foreach(\App\Helpers\getSettingCategory('footer2')->posts as $p) -
  • - - {{$p->title}} - -
  • - @endforeach -
-
- -
-

- اطلاعات تماس -

-

- افراد گروه سوم از اهمیت به پایان رساندن آگاه هستند. آنها با تفکر منطقی، طرحی روشن ارائه می‌کنند. آنها نه تنها برای پایان دادن به پروژه‌ی خود در آینده برنامه ریزی می‌کنند، بلکه به تمام نتایج و عواقب اجرای آن برنامه هم می‌اندیشند. این افراد کسانی هستند که هنر به پایان رساندن را می‌دانند. -

-
-
-

- نمادها -

-
- {!! \App\Helpers\getSetting('footer3') !!} -
-
-
-
- -
-
- {{\App\Helpers\getSetting('copyright')}} - © {{date('Y')}} -
-
-
-
-
- -@yield('js-content') - -@include('component.lang') - - diff --git a/resources/views/website/component/pro.blade.php b/resources/views/website/component/product-box.blade.php similarity index 100% rename from resources/views/website/component/pro.blade.php rename to resources/views/website/component/product-box.blade.php diff --git a/resources/views/website/contact.blade.php b/resources/views/website/contact.blade.php index d755563..fa6dd26 100755 --- a/resources/views/website/contact.blade.php +++ b/resources/views/website/contact.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{$title}} @endsection diff --git a/resources/views/website/customer.blade.php b/resources/views/website/customer.blade.php index c652958..38899ed 100755 --- a/resources/views/website/customer.blade.php +++ b/resources/views/website/customer.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Customer profile")}} - @endsection @@ -534,7 +534,7 @@ @else @foreach(auth('customer')->user()->products as $p)
- @include('website.component.pro',['p' => $p]) + @include('website.component.product-box',['p' => $p])
@endforeach @endif diff --git a/resources/views/website/index.blade.php b/resources/views/website/index.blade.php index b50abf1..46e2e99 100755 --- a/resources/views/website/index.blade.php +++ b/resources/views/website/index.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('content')
diff --git a/resources/views/website/invoice.blade.php b/resources/views/website/invoice.blade.php index 271c667..48d6cfb 100755 --- a/resources/views/website/invoice.blade.php +++ b/resources/views/website/invoice.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Invoice")}} - {{$invoice->id}} @endsection diff --git a/resources/views/website/layout/layout.blade.php b/resources/views/website/layout/layout.blade.php new file mode 100755 index 0000000..32c2131 --- /dev/null +++ b/resources/views/website/layout/layout.blade.php @@ -0,0 +1,9 @@ +@include('website.component.header') + +
+
+ @yield('content') +
+
+ +@include('website.component.footer') diff --git a/resources/views/website/sidebar.blade.php b/resources/views/website/layout/sidebar.blade.php similarity index 100% rename from resources/views/website/sidebar.blade.php rename to resources/views/website/layout/sidebar.blade.php diff --git a/resources/views/website/post.blade.php b/resources/views/website/post.blade.php index b88b2cc..b83a573 100755 --- a/resources/views/website/post.blade.php +++ b/resources/views/website/post.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{$post->title}} - @endsection diff --git a/resources/views/website/posts.blade.php b/resources/views/website/posts.blade.php index 988c483..06adfcf 100755 --- a/resources/views/website/posts.blade.php +++ b/resources/views/website/posts.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{$title}} - @endsection diff --git a/resources/views/website/product.blade.php b/resources/views/website/product.blade.php index faedc97..d62def1 100755 --- a/resources/views/website/product.blade.php +++ b/resources/views/website/product.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{$pro->name}} - @endsection @@ -368,7 +368,7 @@ diff --git a/resources/views/website/products.blade.php b/resources/views/website/products.blade.php index 58f0f81..8325de7 100755 --- a/resources/views/website/products.blade.php +++ b/resources/views/website/products.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Products")}} - @endsection @@ -22,13 +22,13 @@
- @include('website.sidebar') + @include('website.layout.sidebar')
@foreach($products as $pro)
- @include('website.component.pro',['p' => $pro]) + @include('website.component.product-box',['p' => $pro])
@endforeach
diff --git a/resources/views/website/sign.blade.php b/resources/views/website/sign.blade.php index 62d5ca0..3833fa6 100755 --- a/resources/views/website/sign.blade.php +++ b/resources/views/website/sign.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Signup or Login")}} - @endsection diff --git a/resources/views/website/signsms.blade.php b/resources/views/website/signsms.blade.php index aacf8e9..70c7035 100755 --- a/resources/views/website/signsms.blade.php +++ b/resources/views/website/signsms.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Signup or Login")}} - @endsection diff --git a/resources/views/website/ticket.blade.php b/resources/views/website/ticket.blade.php index dc1009b..c80618b 100755 --- a/resources/views/website/ticket.blade.php +++ b/resources/views/website/ticket.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') {{__("Customer profile")}} - @endsection diff --git a/resources/views/website/track.blade.php b/resources/views/website/track.blade.php index 34389bf..792ad51 100755 --- a/resources/views/website/track.blade.php +++ b/resources/views/website/track.blade.php @@ -1,4 +1,4 @@ -@extends('website.layout') +@extends('website.layout.layout') @section('title') کدهای رهگیری - @endsection