From 139aeb8074e9b64e6f631d180d6c4ff755ea8517 Mon Sep 17 00:00:00 2001 From: ludo Date: Sun, 3 Mar 2024 14:44:35 +0100 Subject: [PATCH] fixes --- .../Shop/Auth/RegisterController.php | 2 + .../Requests/Admin/Shop/StoreArticlePost.php | 2 +- app/Repositories/Shop/Articles.php | 4 +- .../Shop/Offers/partials/article.blade.php | 105 ++++++++++-------- resources/views/load/form/save.blade.php | 36 +++--- resources/views/load/layout/chevron.blade.php | 10 +- 6 files changed, 85 insertions(+), 74 deletions(-) diff --git a/app/Http/Controllers/Shop/Auth/RegisterController.php b/app/Http/Controllers/Shop/Auth/RegisterController.php index 6ceac947..66d5e59f 100644 --- a/app/Http/Controllers/Shop/Auth/RegisterController.php +++ b/app/Http/Controllers/Shop/Auth/RegisterController.php @@ -24,11 +24,13 @@ class RegisterController extends Controller $user = $this->create($request->all()); $this->guard()->login($user); + /* $response = $this->registered($request, $user); if ($response) { return $response; } + */ return $request->wantsJson() ? new JsonResponse([], 201) diff --git a/app/Http/Requests/Admin/Shop/StoreArticlePost.php b/app/Http/Requests/Admin/Shop/StoreArticlePost.php index 016338c9..d18cfc12 100644 --- a/app/Http/Requests/Admin/Shop/StoreArticlePost.php +++ b/app/Http/Requests/Admin/Shop/StoreArticlePost.php @@ -14,7 +14,7 @@ class StoreArticlePost extends FormRequest public function rules() { return [ - 'ref' => 'required|unique:shop_articles,ref,'.$this->id, + 'ref' => 'required|unique:shop_articles', 'product_type' => 'required', 'product_id' => 'required', 'article_nature_id' => 'required', diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index 6c7dee60..a3ba0736 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -105,10 +105,10 @@ class Articles } break; case 'App\Models\Botanic\Specie': - $data['specie'] = $article->product->description; + $data['specie'] = $article->product ? $article->product->description : ''; break; case 'App\Models\Shop\Merchandise': - $data['merchandise'] = $article->product->description; + $data['merchandise'] = $article->product ? $article->product->description : ''; $data['producer'] = $article->product->producer->description; break; default: diff --git a/resources/views/Admin/Shop/Offers/partials/article.blade.php b/resources/views/Admin/Shop/Offers/partials/article.blade.php index 4ebbe571..37b7b6d9 100644 --- a/resources/views/Admin/Shop/Offers/partials/article.blade.php +++ b/resources/views/Admin/Shop/Offers/partials/article.blade.php @@ -1,60 +1,67 @@
-
+
-
-
- {{ Form::label('ref', 'Référence') }}
- {{ $article['ref'] ?? null }} -
-
- {{ Form::label('name', 'Nom') }}
- {{ $article['name'] ?? null }} -
-
- -
-
+
+
+ {{ Form::label('ref', 'Référence') }}
+ {{ $article['ref'] ?? null }} +
+
+ {{ Form::label('name', 'Nom') }}
+ {{ $article['name'] ?? null }} +
+
+ +
+
-
-
- {{ Form::label('categories', __('shop.shelves.title')) }}
- @foreach (($article['categories'] ?? null) as $category) - {{ $category }} - @endforeach -
-
+
+
+ {{ Form::label('categories', __('shop.shelves.title')) }}
+ @foreach ($article['categories'] ?? null as $category) + {{ $category }} + @endforeach +
+
-
-
- {{ Form::label('tags', 'Tags') }}
- @foreach (($article['tags'] ?? null) as $tag) - {{ $tag }} - @endforeach -
-
+
+
+ {{ Form::label('tags', 'Tags') }}
+ @foreach ($article['tags'] ?? [] as $tagGroup => $item) + @foreach ($item ?? null as $tag) + {{ $tag }} + @endforeach + @endforeach +
+
-
-
- @include('Admin.Shop.Articles.partials.product.description') -
-
+
+
+ @include('Admin.Shop.Articles.partials.product.description') +
+
-
-
- {{ Form::label('description', 'Description') }} - {!! $article['description']['description'] ?? null !!} -
-
+
+
+ {{ Form::label('description', 'Description') }} + {!! $article['description']['description'] ?? null !!} +
+
-
-
- @include('Admin.Core.Comments.partials.comments', ['model' => 'Shop.Article', 'model_id' => $article['id'] ?? false, 'comments' => $article['comments'], 'with_add' => false]) -
-
+
+
+ @include('Admin.Core.Comments.partials.comments', [ + 'model' => 'Shop.Article', + 'model_id' => $article['id'] ?? false, + 'comments' => $article['comments'], + 'with_add' => false, + ]) +
+
-
+
\ No newline at end of file + initChevron(); + diff --git a/resources/views/load/form/save.blade.php b/resources/views/load/form/save.blade.php index 7605aff1..f01b2868 100644 --- a/resources/views/load/form/save.blade.php +++ b/resources/views/load/form/save.blade.php @@ -1,18 +1,20 @@ @once - @push('scripts') - - @endpush - @php(define('LOAD_SAVE', true)) -@endonce \ No newline at end of file + @push('scripts') + + @endpush + @php(define('LOAD_SAVE', true)) +@endonce diff --git a/resources/views/load/layout/chevron.blade.php b/resources/views/load/layout/chevron.blade.php index 9a9eebed..fff81e7b 100644 --- a/resources/views/load/layout/chevron.blade.php +++ b/resources/views/load/layout/chevron.blade.php @@ -1,15 +1,15 @@ -@if(!defined('LOAD_CHEVRON')) - @push('scripts') +@if (!defined('LOAD_CHEVRON')) + @push('scripts') @component('boilerplate::minify') @endcomponent - @endpush - @php(define('LOAD_CHEVRON', true)) + @endpush + @php(define('LOAD_CHEVRON', true)) @endif