2026-02-06 14:56:56 +02:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
|
|
|
|
@section('content')
|
2026-02-14 16:11:09 +02:00
|
|
|
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
|
|
|
<div class="mb-8">
|
2026-10-17 16:24:26 +03:00
|
|
|
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">Edit Product</h1>
|
|
|
|
|
<p class="mt-2 text-sm text-gray-600 dark:text-gray-400">Update your product information and details</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
|
2026-10-17 16:24:26 +03:00
|
|
|
<div class="bg-white dark:bg-gray-800 shadow-sm rounded-lg">
|
2026-02-14 16:11:09 +02:00
|
|
|
<div class="px-4 py-5 sm:p-6">
|
|
|
|
|
<form method="POST" action="{{ route('products.update', $product) }}" enctype="multipart/form-data" class="space-y-6">
|
|
|
|
|
@csrf
|
|
|
|
|
@method('PUT')
|
|
|
|
|
|
|
|
|
|
<!-- Title -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="title" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
|
|
|
Product Title <span class="text-red-600 dark:text-red-400">*</span>
|
2026-02-14 16:11:09 +02:00
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<input type="text"
|
|
|
|
|
id="title"
|
|
|
|
|
name="title"
|
|
|
|
|
value="{{ old('title', $product->title) }}"
|
|
|
|
|
required
|
|
|
|
|
maxlength="255"
|
|
|
|
|
placeholder="e.g., My Awesome Product"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('title') border-red-300 text-red-900 dark:text-red-200 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror dark:bg-gray-700">
|
2026-02-14 16:11:09 +02:00
|
|
|
@error('title')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">A catchy, descriptive title for your product.</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
2026-02-06 14:56:56 +02:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-14 16:11:09 +02:00
|
|
|
<!-- Description -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="description" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
|
|
|
Description <span class="text-red-600 dark:text-red-400">*</span>
|
2026-02-14 16:11:09 +02:00
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<textarea id="description"
|
|
|
|
|
name="description"
|
|
|
|
|
rows="5"
|
|
|
|
|
required
|
|
|
|
|
placeholder="Tell us about your product..."
|
2026-10-17 16:24:26 +03:00
|
|
|
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('description') border-red-300 text-red-900 dark:text-red-200 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror dark:bg-gray-700">{{ old('description', $product->description) }}</textarea>
|
2026-02-14 16:11:09 +02:00
|
|
|
@error('description')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Provide a detailed description of your product (what it does, key features, etc.).</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
2026-02-06 14:56:56 +02:00
|
|
|
</div>
|
2026-02-14 16:11:09 +02:00
|
|
|
|
|
|
|
|
<!-- Website URL -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="website_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
|
|
|
Website URL <span class="text-red-600 dark:text-red-400">*</span>
|
2026-02-14 16:11:09 +02:00
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<input type="url"
|
|
|
|
|
id="website_url"
|
|
|
|
|
name="website_url"
|
|
|
|
|
value="{{ old('website_url', $product->website_url) }}"
|
|
|
|
|
required
|
|
|
|
|
placeholder="https://example.com"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('website_url') border-red-300 text-red-900 dark:text-red-200 placeholder-red-300 focus:ring-red-500 focus:border-red-500 @enderror dark:bg-gray-700">
|
2026-02-14 16:11:09 +02:00
|
|
|
@error('website_url')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">The full URL to your product's website or landing page.</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Category -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="category_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
|
|
|
|
Category <span class="text-red-600 dark:text-red-400">*</span>
|
2026-02-14 16:11:09 +02:00
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<select id="category_id"
|
|
|
|
|
name="category_id"
|
|
|
|
|
required
|
2026-10-17 16:24:26 +03:00
|
|
|
class="appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm @error('category_id') border-red-300 text-red-900 dark:text-red-200 focus:ring-red-500 focus:border-red-500 @enderror dark:bg-gray-700">
|
2026-02-14 16:11:09 +02:00
|
|
|
<option value="">Select a category...</option>
|
|
|
|
|
@foreach($categories as $category)
|
|
|
|
|
<option value="{{ $category->id }}" {{ old('category_id', $product->category_id) == $category->id ? 'selected' : '' }}>
|
|
|
|
|
{{ $category->name }}
|
|
|
|
|
</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
@error('category_id')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Choose the category that best fits your product.</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-21 16:12:57 +02:00
|
|
|
<!-- Tags -->
|
|
|
|
|
@if($tags->count() > 0)
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
2026-02-21 16:12:57 +02:00
|
|
|
Tags
|
|
|
|
|
</label>
|
|
|
|
|
<div class="mt-1 space-y-2">
|
|
|
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
|
|
|
|
@foreach($tags as $tag)
|
|
|
|
|
@php
|
|
|
|
|
$isChecked = old('tags')
|
|
|
|
|
? in_array($tag->id, old('tags'))
|
|
|
|
|
: $product->tags->contains($tag->id);
|
|
|
|
|
@endphp
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="relative flex items-start p-3 border border-gray-300 dark:border-gray-600 rounded-md cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">
|
2026-02-21 16:12:57 +02:00
|
|
|
<div class="flex items-center h-5">
|
|
|
|
|
<input type="checkbox"
|
|
|
|
|
name="tags[]"
|
|
|
|
|
value="{{ $tag->id }}"
|
|
|
|
|
{{ $isChecked ? 'checked' : '' }}
|
2026-10-17 16:24:26 +03:00
|
|
|
class="focus:ring-primary-500 h-4 w-4 text-primary-600 dark:text-primary-400 border-gray-300 dark:border-gray-600 rounded">
|
2026-02-21 16:12:57 +02:00
|
|
|
</div>
|
|
|
|
|
<div class="ml-3 flex-1">
|
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<span class="inline-block w-3 h-3 rounded-full" style="background-color: {{ $tag->color }}"></span>
|
2026-10-17 16:24:26 +03:00
|
|
|
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ $tag->name }}</span>
|
2026-02-21 16:12:57 +02:00
|
|
|
</div>
|
|
|
|
|
@if($tag->description)
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">{{ $tag->description }}</p>
|
2026-02-21 16:12:57 +02:00
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
</label>
|
|
|
|
|
@endforeach
|
|
|
|
|
</div>
|
|
|
|
|
@error('tags')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-21 16:12:57 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Select all tags that apply to your product.</p>
|
2026-02-21 16:12:57 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
2026-10-17 15:56:58 +03:00
|
|
|
@php
|
|
|
|
|
$badgesLocked = $product->status === 'approved' && !auth()->user()->hasAnyRole(['moderator', 'admin']);
|
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
|
|
<!-- Badges -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
2026-10-17 15:56:58 +03:00
|
|
|
Badges
|
|
|
|
|
</label>
|
|
|
|
|
<div class="mt-1 grid grid-cols-2 sm:grid-cols-4 gap-3">
|
|
|
|
|
@foreach(\App\Models\Product::BADGES as $key => $label)
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="flex items-center p-3 border border-gray-300 dark:border-gray-600 rounded-md">
|
2026-10-17 15:56:58 +03:00
|
|
|
<input type="hidden" name="{{ $key }}" value="0">
|
|
|
|
|
<input type="checkbox"
|
|
|
|
|
name="{{ $key }}"
|
|
|
|
|
value="1"
|
|
|
|
|
{{ old($key, $product->{$key}) ? 'checked' : '' }}
|
|
|
|
|
{{ $badgesLocked ? 'disabled' : '' }}
|
2026-10-17 16:24:26 +03:00
|
|
|
class="focus:ring-primary-500 h-4 w-4 text-primary-600 dark:text-primary-400 border-gray-300 dark:border-gray-600 rounded">
|
|
|
|
|
<span class="ml-2 text-sm text-gray-900 dark:text-white">{{ $label }}</span>
|
2026-10-17 15:56:58 +03:00
|
|
|
</label>
|
|
|
|
|
@endforeach
|
|
|
|
|
</div>
|
|
|
|
|
@if($badgesLocked)
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Locked after approval</p>
|
2026-10-17 15:56:58 +03:00
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-02-14 16:11:09 +02:00
|
|
|
<!-- Current Thumbnail -->
|
|
|
|
|
@if($product->thumbnail_url)
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Current Thumbnail:</label>
|
2026-02-14 16:11:09 +02:00
|
|
|
<div class="mt-1">
|
|
|
|
|
<img src="{{ $product->thumbnail_url }}"
|
|
|
|
|
alt="{{ $product->title }}"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="max-w-xs rounded-lg border border-gray-300 dark:border-gray-600 shadow-sm">
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<!-- New Thumbnail -->
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="thumbnail" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
2026-02-14 16:11:09 +02:00
|
|
|
{{ $product->thumbnail_url ? 'Replace Thumbnail' : 'Product Thumbnail' }}
|
|
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<input type="file"
|
|
|
|
|
id="thumbnail"
|
|
|
|
|
name="thumbnail"
|
|
|
|
|
accept="image/*"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="block w-full text-sm text-gray-500 dark:text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100 @error('thumbnail') border-red-300 dark:border-red-700 @enderror">
|
2026-02-14 16:11:09 +02:00
|
|
|
@error('thumbnail')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
@enderror
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Upload a product screenshot or logo (JPEG, PNG, or GIF, max 2MB).</p>
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Image Preview -->
|
|
|
|
|
<div id="imagePreview" class="hidden">
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">New Preview:</label>
|
2026-02-14 16:11:09 +02:00
|
|
|
<div class="mt-1">
|
2026-10-17 16:24:26 +03:00
|
|
|
<img id="preview" src="#" alt="Thumbnail preview" class="max-w-xs rounded-lg border border-gray-300 dark:border-gray-600 shadow-sm">
|
2026-02-14 16:11:09 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-17 16:00:23 +03:00
|
|
|
@if($product->screenshots->isNotEmpty())
|
|
|
|
|
<div>
|
2026-10-17 16:24:26 +03:00
|
|
|
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Current Screenshots:</label>
|
2026-10-17 16:00:23 +03:00
|
|
|
<div class="mt-1 grid grid-cols-2 sm:grid-cols-4 gap-3">
|
|
|
|
|
@foreach($product->screenshots as $shot)
|
|
|
|
|
<label class="block">
|
2026-10-17 16:24:26 +03:00
|
|
|
<img src="{{ $shot->url }}" alt="" class="h-24 w-full object-cover rounded border border-gray-300 dark:border-gray-600">
|
|
|
|
|
<span class="mt-1 flex items-center text-sm text-gray-700 dark:text-gray-300">
|
2026-10-17 16:00:23 +03:00
|
|
|
<input type="checkbox" name="remove_screenshots[]" value="{{ $shot->id }}"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="h-4 w-4 text-primary-600 dark:text-primary-400 border-gray-300 dark:border-gray-600 rounded">
|
2026-10-17 16:00:23 +03:00
|
|
|
<span class="ml-2">Remove</span>
|
|
|
|
|
</span>
|
|
|
|
|
</label>
|
|
|
|
|
@endforeach
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
<!-- Screenshots -->
|
|
|
|
|
<div x-data="{ previews: [] }">
|
2026-10-17 16:24:26 +03:00
|
|
|
<label for="screenshots" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
2026-10-17 16:00:23 +03:00
|
|
|
Screenshots
|
|
|
|
|
</label>
|
|
|
|
|
<div class="mt-1">
|
|
|
|
|
<input type="file"
|
|
|
|
|
id="screenshots"
|
|
|
|
|
name="screenshots[]"
|
|
|
|
|
accept="image/*"
|
|
|
|
|
multiple
|
|
|
|
|
@change="previews = Array.from($event.target.files).map(f => URL.createObjectURL(f))"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="block w-full text-sm text-gray-500 dark:text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100">
|
2026-10-17 16:00:23 +03:00
|
|
|
@error('screenshots')
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
2026-10-17 16:00:23 +03:00
|
|
|
@enderror
|
|
|
|
|
@foreach($errors->get('screenshots.*') as $messages)
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $messages[0] }}</p>
|
2026-10-17 16:00:23 +03:00
|
|
|
@endforeach
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Add several images (JPEG, PNG, or GIF, max 2MB each).</p>
|
2026-10-17 16:00:23 +03:00
|
|
|
<div class="mt-3 flex flex-wrap gap-2" x-show="previews.length" style="display: none">
|
|
|
|
|
<template x-for="src in previews" :key="src">
|
2026-10-17 16:24:26 +03:00
|
|
|
<img :src="src" alt="" class="h-20 w-28 object-cover rounded border border-gray-300 dark:border-gray-600">
|
2026-10-17 16:00:23 +03:00
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-17 16:02:27 +03:00
|
|
|
<x-product.plans-form :plans="$product->pricingPlans->toArray()" />
|
|
|
|
|
|
2026-10-17 16:12:31 +03:00
|
|
|
<x-product.team-form :members="$product->members" :readonly="! (auth()->id() === $product->user_id || auth()->user()->isAdmin())" />
|
2026-10-17 16:04:25 +03:00
|
|
|
|
2026-02-14 16:11:09 +02:00
|
|
|
<!-- Info Alert -->
|
2026-10-17 16:24:26 +03:00
|
|
|
<div class="rounded-md bg-blue-50 dark:bg-blue-900/20 p-4">
|
2026-02-14 16:11:09 +02:00
|
|
|
<div class="flex">
|
|
|
|
|
<div class="flex-shrink-0">
|
|
|
|
|
<svg class="h-5 w-5 text-blue-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
|
|
|
|
|
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
|
|
|
|
</svg>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ml-3 flex-1">
|
2026-10-17 16:24:26 +03:00
|
|
|
<p class="text-sm text-blue-700 dark:text-blue-300">
|
2026-02-14 16:11:09 +02:00
|
|
|
<strong>Note:</strong> Changes to your product may need to be reviewed by moderators before appearing on the site.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Submit Buttons -->
|
2026-10-17 16:24:26 +03:00
|
|
|
<div class="flex items-center justify-between pt-5 border-t border-gray-200 dark:border-gray-700">
|
2026-02-14 16:11:09 +02:00
|
|
|
<a href="{{ route('products.show', $product) }}"
|
2026-10-17 16:24:26 +03:00
|
|
|
class="inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
2026-02-14 16:11:09 +02:00
|
|
|
Cancel
|
|
|
|
|
</a>
|
|
|
|
|
<button type="submit"
|
|
|
|
|
class="inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
|
|
|
|
<svg class="mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
|
|
|
|
</svg>
|
|
|
|
|
Update Product
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
2026-02-06 14:56:56 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@push('scripts')
|
|
|
|
|
<script>
|
|
|
|
|
document.getElementById('thumbnail').addEventListener('change', function(e) {
|
|
|
|
|
const file = e.target.files[0];
|
|
|
|
|
if (file) {
|
|
|
|
|
const reader = new FileReader();
|
|
|
|
|
reader.onload = function(e) {
|
|
|
|
|
document.getElementById('preview').src = e.target.result;
|
2026-02-14 16:11:09 +02:00
|
|
|
document.getElementById('imagePreview').classList.remove('hidden');
|
2026-02-06 14:56:56 +02:00
|
|
|
}
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
} else {
|
2026-02-14 16:11:09 +02:00
|
|
|
document.getElementById('imagePreview').classList.add('hidden');
|
2026-02-06 14:56:56 +02:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
@endpush
|
|
|
|
|
@endsection
|