AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
59%
Quality Avg
?
64%
Security Avg
?
45%
Reviews
?
57
Review Result ?
jattin01/avriti-backend · 76fafc6f
The commit introduces multiple new features and fixes, including adding support for combo products in wishlists and improving validation for product categories, types, and variants. There are migrations to support these changes, and careful attention to data integrity with unique constraints and foreign keys. However, the commit message is generic and does not describe the specific changes or rationale. Some minor risk of bugs exists due to complex migration operations and the introduction of combo product logic.
Quality
?
75%
Security
?
80%
Business Value
?
70%
Maintainability
?
75%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague Commit Message
Where
commit message
Issue / Evidence
vague commit message
Suggested Fix
update the commit message to clearly describe the bug fixes and new features to improve business value and maintainability
Method Lacks Phpdoc
Where
app/Http/Controllers/Api/WishlistController.php:133
Issue / Evidence
method lacks PHPDoc
Suggested Fix
add PHPDoc for formatComboItem method to improve code quality
Long Function
Where
database/migrations/2026_06_24_055203_add_combo_product_id_to_wishlists_table.php:26
Issue / Evidence
migration changes complex
Suggested Fix
add comments to explain the migration steps and rationale to reduce bug risk
Magic Strings Usage
Where
app/Http/Controllers/AdminOrderController.php:45
Issue / Evidence
magic strings usage
Suggested Fix
define constants for order and payment statuses to improve code quality and reduce bugs
Long Function
Where
app/Http/Controllers/Api/AddressController.php:60
Issue / Evidence
complex logic for default address
Suggested Fix
add inline comments to explain this logic for maintainability
Code Change Preview · .gitignore
?
Removed / Before Commit
- Homestead.json - Homestead.yaml - Thumbs.db - \ No newline at end of file
Added / After Commit
+ Homestead.json + Homestead.yaml + Thumbs.db + + + # Custom Ignore + + # Custom Ignore + .claude + avrithi.xlsx + /.claude + /avrithi.xlsx + \ No newline at end of file
Removed / Before Commit
- return view('admin.orders', compact('orders')); - } - - public function show(Order $order): View - { - $order->load(['customer', 'items.comboProduct.items.product.variant']); - ]); - - $order->order_status = $request->order_status; - $order->save(); - - if ($request->expectsJson() || $request->ajax()) {
Added / After Commit
+ return view('admin.orders', compact('orders')); + } + + public function transactions(): View + { + $orders = Order::with(['customer', 'items']) + ->latest() + // ->latest('created_at') + ->get(); + + return view('admin.transactions', compact('orders')); + } + + public function show(Order $order): View + { + $order->load(['customer', 'items.comboProduct.items.product.variant']); + ]); +
Removed / Before Commit
- use Illuminate\Http\RedirectResponse; - use Illuminate\Http\Request; - use Illuminate\Support\Str; - use Illuminate\Validation\ValidationException; - use Illuminate\View\View; - - - public function update(Request $request, ProductCategory $productCategory): RedirectResponse - { - $validated = $this->validateCategory($request); - $slug = $this->prepareSlug($validated['slug'] ?? '', $validated['name']); - - $this->ensureSlugIsUnique($slug, $productCategory->id); - /** - * @return array{name:string, slug?:string|null, description?:string|null, is_active:bool} - */ - private function validateCategory(Request $request): array - {
Added / After Commit
+ use Illuminate\Http\RedirectResponse; + use Illuminate\Http\Request; + use Illuminate\Support\Str; + use Illuminate\Validation\Rule; + use Illuminate\Validation\ValidationException; + use Illuminate\View\View; + + + public function update(Request $request, ProductCategory $productCategory): RedirectResponse + { + $validated = $this->validateCategory($request, $productCategory->id); + $slug = $this->prepareSlug($validated['slug'] ?? '', $validated['name']); + + $this->ensureSlugIsUnique($slug, $productCategory->id); + /** + * @return array{name:string, slug?:string|null, description?:string|null, is_active:bool} + */ + private function validateCategory(Request $request, ?int $ignoreId = null): array
Removed / Before Commit
- - return view('admin.products', [ - 'products' => $products, - 'categories' => ProductCategory::query()->orderBy('name')->get(), - 'types' => ProductType::query()->orderBy('name')->get(), - 'variants' => Variant::query() - ->orderByDesc('is_active') - ->orderBy('name') - ->get(), - ]);
Added / After Commit
+ + return view('admin.products', [ + 'products' => $products, + 'categories' => ProductCategory::query() + ->where('is_active', true) + ->orderBy('name') + ->get(), + 'types' => ProductType::query() + ->where('is_active', true) + ->orderBy('name') + ->get(), + 'variants' => Variant::query() + ->where('is_active', true) + ->orderBy('name') + ->get(), + ]);
Removed / Before Commit
- use Illuminate\Http\RedirectResponse; - use Illuminate\Http\Request; - use Illuminate\Support\Str; - use Illuminate\Validation\ValidationException; - use Illuminate\View\View; - - - public function update(Request $request, ProductType $productType): RedirectResponse - { - $validated = $this->validateType($request); - $slug = $this->prepareSlug($validated['slug'] ?? '', $validated['name']); - - $this->ensureSlugIsUnique($slug, $productType->id); - /** - * @return array{name:string, slug?:string|null, is_active:bool} - */ - private function validateType(Request $request): array - {
Added / After Commit
+ use Illuminate\Http\RedirectResponse; + use Illuminate\Http\Request; + use Illuminate\Support\Str; + use Illuminate\Validation\Rule; + use Illuminate\Validation\ValidationException; + use Illuminate\View\View; + + + public function update(Request $request, ProductType $productType): RedirectResponse + { + $validated = $this->validateType($request, $productType->id); + $slug = $this->prepareSlug($validated['slug'] ?? '', $validated['name']); + + $this->ensureSlugIsUnique($slug, $productType->id); + /** + * @return array{name:string, slug?:string|null, is_active:bool} + */ + private function validateType(Request $request, ?int $ignoreId = null): array
Removed / Before Commit
- use App\Models\Variant; - use Illuminate\Http\RedirectResponse; - use Illuminate\Http\Request; - use Illuminate\View\View; - - class AdminVariantController extends Controller - - public function update(Request $request, Variant $variant): RedirectResponse - { - $validated = $this->validateVariant($request); - - $variant->update([ - 'name' => $validated['name'], - /** - * @return array{name:string, unit?:string|null, is_active:bool} - */ - private function validateVariant(Request $request): array - {
Added / After Commit
+ use App\Models\Variant; + use Illuminate\Http\RedirectResponse; + use Illuminate\Http\Request; + use Illuminate\Validation\Rule; + use Illuminate\View\View; + + class AdminVariantController extends Controller + + public function update(Request $request, Variant $variant): RedirectResponse + { + $validated = $this->validateVariant($request, $variant->id); + + $variant->update([ + 'name' => $validated['name'], + /** + * @return array{name:string, unit?:string|null, is_active:bool} + */ + private function validateVariant(Request $request, ?int $ignoreId = null): array
Removed / Before Commit
- public function update(Request $request, int $id) - { - $request->validate([ - 'email' => ['nullable', 'email'], - ]); - - $address = Address::where('id', $id)->where('customer_id', $request->user()->id)->firstOrFail(); - - if ($request->boolean('is_default')) { - Address::where('customer_id', $request->user()->id)->update(['is_default' => false]); - } - - $address->update([ - ...$request->only(['full_name','phone','email','address_line1','address_line2','landmark','city','state','pincode','country','address_type']), - 'is_default' => $request->boolean('is_default'), - ]); - - return response()->json(['success' => true, 'data' => $address]);
Added / After Commit
+ public function update(Request $request, int $id) + { + $request->validate([ + 'email' => ['nullable', 'email'], + 'is_default' => ['sometimes', 'boolean'], + ]); + + $customerId = $request->user()->id; + $address = Address::where('id', $id)->where('customer_id', $customerId)->firstOrFail(); + + // Only touch is_default if the client explicitly sent it; otherwise keep the existing value. + $isDefault = $request->has('is_default') ? $request->boolean('is_default') : $address->is_default; + + // Never allow unsetting the only/current default without another address taking its place. + if ($address->is_default && ! $isDefault) { + $hasOtherAddress = Address::where('customer_id', $customerId)->where('id', '!=', $address->id)->exists(); + if (! $hasOtherAddress) { + $isDefault = true;
Removed / Before Commit
- try { - Mail::to($billingEmail)->send(new OrderPlacedMail([ - 'order_number' => $orderNumber, - 'billing_address' => $billingAddress, - 'billing_email' => $billingEmail, - 'payment_method' => $request->input('payment_method'),
Added / After Commit
+ try { + Mail::to($billingEmail)->send(new OrderPlacedMail([ + 'order_number' => $orderNumber, + 'shipping_address' => $shippingAddress, + 'shipping_email' => $request->input('shipping_email', $shippingAddress['email'] ?? null), + 'billing_address' => $billingAddress, + 'billing_email' => $billingEmail, + 'payment_method' => $request->input('payment_method'),
Removed / Before Commit
- 'order_number' => $orderNumber, - 'billing_address' => $billingAddress, - 'shipping_address' => $shippingAddress, - 'billing_email' => $billingEmail, - 'payment_method' => 'razorpay', - 'razorpay_payment_id' => $request->razorpay_payment_id,
Added / After Commit
+ 'order_number' => $orderNumber, + 'billing_address' => $billingAddress, + 'shipping_address' => $shippingAddress, + 'shipping_email' => $request->input('shipping_email', $shippingAddress['email'] ?? null), + 'billing_email' => $billingEmail, + 'payment_method' => 'razorpay', + 'razorpay_payment_id' => $request->razorpay_payment_id,
Removed / Before Commit
- namespace App\Http\Controllers\Api; - - use App\Http\Controllers\Controller; - use App\Models\Product; - use App\Models\Wishlist; - use Illuminate\Http\JsonResponse; - { - public function index(Request $request): JsonResponse - { - $items = Wishlist::with('product.variant', 'product.category') - ->where('customer_id', $request->user()->id) - ->latest() - ->get() - public function store(Request $request): JsonResponse - { - $data = $request->validate([ - 'product_id' => ['required', 'integer', 'exists:products,id'], - 'attribute_name' => ['nullable', 'string'],
Added / After Commit
+ namespace App\Http\Controllers\Api; + + use App\Http\Controllers\Controller; + use App\Models\ComboProduct; + use App\Models\Product; + use App\Models\Wishlist; + use Illuminate\Http\JsonResponse; + { + public function index(Request $request): JsonResponse + { + $items = Wishlist::with('product.variant', 'product.category', 'comboProduct') + ->where('customer_id', $request->user()->id) + ->latest() + ->get() + public function store(Request $request): JsonResponse + { + $data = $request->validate([ + 'product_id' => ['nullable', 'integer', 'exists:products,id', 'required_without:combo_product_id'],
Removed / Before Commit
- protected $fillable = [ - 'customer_id', - 'product_id', - 'attribute_name', - 'attribute_value', - ]; - return $this->belongsTo(Product::class); - } - - public function customer(): BelongsTo - { - return $this->belongsTo(Customer::class);
Added / After Commit
+ protected $fillable = [ + 'customer_id', + 'product_id', + 'combo_product_id', + 'attribute_name', + 'attribute_value', + ]; + return $this->belongsTo(Product::class); + } + + public function comboProduct(): BelongsTo + { + return $this->belongsTo(ComboProduct::class); + } + + public function customer(): BelongsTo + { + return $this->belongsTo(Customer::class);
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + /** + * Run the migrations. + */ + public function up(): void + { + // MySQL needs a dedicated index covering customer_id (the FK column) + // before the composite unique index — which currently serves that + // purpose — can be dropped. + DB::statement('ALTER TABLE wishlists ADD INDEX wishlists_customer_id_temp_index (customer_id)');
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::table('product_categories', function (Blueprint $table) { + $table->unique('name'); + }); + + Schema::table('product_types', function (Blueprint $table) { + $table->unique('name'); + }); +
Removed / Before Commit
- type="text" - name="full_name" - value="{{ old('full_name', $customer->full_name) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('full_name') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - type="text" - name="phone" - value="{{ old('phone', $customer->phone) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('phone') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Added / After Commit
+ type="text" + name="full_name" + value="{{ old('full_name', $customer->full_name) }}" + + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('full_name') + <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + type="text" + name="phone" + value="{{ old('phone', $customer->phone) }}" + + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('phone') + <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Removed / Before Commit
- </div> - - {{-- Default Address --}} - @if ($defaultAddress) - <div class="rounded-[24px] bg-white shadow-sm p-6"> - <h3 class="text-sm font-semibold text-[#0b3dba] mb-4 flex items-center gap-2"> - <i class="fa-solid fa-location-dot"></i> Default Address - @endif - </div> - </div> - @endif - </div> - - {{-- Right: Orders + All Addresses --}} - <th class="px-6 py-3">Payment</th> - <th class="px-6 py-3">Payment Status</th> - <th class="px-6 py-3">Status</th> - </tr>
Added / After Commit
+ </div> + + {{-- Default Address --}} + <!-- @if ($defaultAddress) + <div class="rounded-[24px] bg-white shadow-sm p-6"> + <h3 class="text-sm font-semibold text-[#0b3dba] mb-4 flex items-center gap-2"> + <i class="fa-solid fa-location-dot"></i> Default Address + @endif + </div> + </div> + @endif --> + </div> + + {{-- Right: Orders + All Addresses --}} + <th class="px-6 py-3">Payment</th> + <th class="px-6 py-3">Payment Status</th> + <th class="px-6 py-3">Status</th> + <th class="px-6 py-3 text-center">Action</th>
Removed / Before Commit
- value="{{ old('name', $category?->name) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('name') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - value="{{ old('slug', $category?->slug) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('slug') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - rows="4" - class="w-full px-4 py-3 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent">{{ old('description', $category?->description) }}</textarea> - @error('description') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Added / After Commit
+ value="{{ old('name', $category?->name) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('name') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + value="{{ old('slug', $category?->slug) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('slug') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + rows="4" + class="w-full px-4 py-3 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent">{{ old('description', $category?->description) }}</textarea> + @error('description') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Removed / Before Commit
- @endforeach - </select> - @error('category_id') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - @endforeach - </select> - @error('product_type_id') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - value="{{ old('title', $product?->title) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('title') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Added / After Commit
+ @endforeach + </select> + @error('category_id') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + @endforeach + </select> + @error('product_type_id') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + value="{{ old('title', $product?->title) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('title') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Removed / Before Commit
- value="{{ old('name', $type?->name) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('name') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - value="{{ old('slug', $type?->slug) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('slug') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - </label> - </div> - @error('is_active') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Added / After Commit
+ value="{{ old('name', $type?->name) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('name') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + value="{{ old('slug', $type?->slug) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('slug') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + </label> + </div> + @error('is_active') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p>
Removed / Before Commit
- value="{{ old('name', $variant?->name) }}" - class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - @error('name') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - - </label> - </div> - @error('is_active') - <p class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> - @enderror - </div> - </div>
Added / After Commit
+ value="{{ old('name', $variant?->name) }}" + class="w-full h-12 px-4 border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + @error('name') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + + </label> + </div> + @error('is_active') + <p data-error-message class="mt-2 text-xs font-medium text-red-500">{{ $message }}</p> + @enderror + </div> + </div>
Removed / Before Commit
- const closeModal = (modal) => { - modal?.classList.add('hidden'); - document.body.classList.remove('overflow-hidden'); - }; - - document.addEventListener('click', (event) => {
Added / After Commit
+ const closeModal = (modal) => { + modal?.classList.add('hidden'); + document.body.classList.remove('overflow-hidden'); + modal?.querySelector('form')?.reset(); + modal?.querySelectorAll('[data-error-message]').forEach((el) => el.remove()); + }; + + document.addEventListener('click', (event) => {
Removed / Before Commit
- const closeModal = (modal) => { - modal?.classList.add('hidden'); - document.body.classList.remove('overflow-hidden'); - }; - - document.addEventListener('click', (event) => {
Added / After Commit
+ const closeModal = (modal) => { + modal?.classList.add('hidden'); + document.body.classList.remove('overflow-hidden'); + modal?.querySelector('form')?.reset(); + modal?.querySelectorAll('[data-error-message]').forEach((el) => el.remove()); + }; + + document.addEventListener('click', (event) => {
Removed / Before Commit
- const closeModal = (modal) => { - modal?.classList.add('hidden'); - document.body.classList.remove('overflow-hidden'); - }; - - const refreshRepeaterNumbers = (repeater) => { - }, 3500); - }); - - const toolbarOptions = [ - [{ 'header': [1, 2, 3, false] }], - ['bold', 'italic', 'underline'], - quill.root.innerHTML = textarea.value; - } - - quill.on('text-change', function () { - const html = quill.root.innerHTML; - textarea.value = html === '<p><br></p>' ? '' : html;
Added / After Commit
+ const closeModal = (modal) => { + modal?.classList.add('hidden'); + document.body.classList.remove('overflow-hidden'); + modal?.querySelectorAll('[data-error-message], .js-validation-error').forEach((el) => el.remove()); + }; + + const refreshRepeaterNumbers = (repeater) => { + }, 3500); + }); + + const MAX_THUMBNAIL_BYTES = 1 * 1024 * 1024; + + const showFieldError = (anchorEl, message) => { + if (! anchorEl) return; + const insertAfter = anchorEl.nextElementSibling?.classList?.contains('select2-container') + ? anchorEl.nextElementSibling + : anchorEl; + let msg = insertAfter.parentElement?.querySelector('.js-validation-error');
Removed / Before Commit
- <table id="taxSettingsTable" data-action-column="4" class="{{ $taxSettings->isNotEmpty() ? 'js-data-table' : '' }} min-w-full border-separate border-spacing-0 text-left text-sm text-gray-600"> - <thead class="bg-[#0b3dba] text-xs uppercase tracking-[0.2em] text-white"> - <tr> - <th class="px-6 py-4">Country</th> - <th class="px-6 py-4">Components</th> - <th class="px-6 py-4">Total Rate</th> - <th class="px-6 py-4">Status</th> - <th class="px-6 py-4">Action</th> - </tr> - </thead> - <tbody class="divide-y divide-gray-100 text-sm [&>tr:nth-child(even)]:bg-gray-100"> - <form method="POST" action="{{ route('tax-settings.activate', $taxSetting) }}"> - @csrf - @method('PATCH') - <button type="submit" class="text-emerald-600 hover:text-emerald-700" aria-label="Activate {{ $taxSetting->country_name }}"> - <i class="fa-solid fa-circle-check"></i> - </button> - </form>
Added / After Commit
+ <table id="taxSettingsTable" data-action-column="4" class="{{ $taxSettings->isNotEmpty() ? 'js-data-table' : '' }} min-w-full border-separate border-spacing-0 text-left text-sm text-gray-600"> + <thead class="bg-[#0b3dba] text-xs uppercase tracking-[0.2em] text-white"> + <tr> + <th class="px-6 py-4 w-[15%]">Country</th> + <th class="px-6 py-4 w-[40%]">Components</th> + <th class="px-6 py-4 w-[15%]">Total Rate</th> + <th class="px-6 py-4 w-[15%]">Status</th> + <th class="px-6 py-4 w-[15%]">Action</th> + </tr> + </thead> + <tbody class="divide-y divide-gray-100 text-sm [&>tr:nth-child(even)]:bg-gray-100"> + <form method="POST" action="{{ route('tax-settings.activate', $taxSetting) }}"> + @csrf + @method('PATCH') + <button type="submit" class="relative group text-emerald-600 hover:text-emerald-700" aria-label="Activate {{ $taxSetting->country_name }}"> + <i class="fa-solid fa-circle-check"></i> + <span class="absolute -top-8 left-1/2 -translate-x-1/2 bg-gray-800 text-white text-xs rounded px-2 py-1 opacity-0 group-hover:opacity-100 transition whitespace-nowrap">Activate</span> + </button>
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('title', 'Transactions | Avriti Dashboard') + @section('content') + + <div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"> + <div> + <h1 class="text-2xl font-semibold text-[#0b3dba]">Transactions</h1> + </div> + </div> + + <div class="bg-white rounded-2xl shadow-sm overflow-hidden"> + <div class="overflow-x-auto px-4 py-4"> + <table id="transactionsTable" data-action-column="7" class="{{ $orders->isNotEmpty() ? 'js-data-table' : '' }} w-full text-sm text-left text-gray-600"> + <thead class="bg-[#0b3dba] border-b border-gray-200 text-gray-500"> + <tr> + <th class="px-5 py-4 font-semibold text-white">Order No</th> + <th class="px-5 py-4 font-semibold text-white">Customer</th>
Removed / Before Commit
- <input - type="file" - name="user_img" - accept="image/jpeg,image/png,image/webp" - class="border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent block w-full rounded-md text-sm text-gray-700 outline-none file:mr-4 file:rounded-md file:border-0 file:bg-[#0b3dba] file:px-4 file:py-2 file:text-sm file:font-semibold file:text-white focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> - <p class="text-xs text-gray-400">JPG, PNG, or WEBP. Max 2MB.</p> - </div> - <div class="w-40 ms-2"> - @if ($profile?->user_img) - <img src="{{ asset($profile->user_img) }}" alt="{{ old('name', $profile?->name) ?: $user->username }}" class="h-24 w-24 rounded-2xl border-2 border-[#0b3dba] object-cover" /> - @else - <div class="h-24 w-24 rounded-2xl border-2 border-[#0b3dba] bg-white flex items-center justify-center text-[#0b3dba]"> - <i class="fa-solid fa-user text-2xl"></i> - </div> - @endif - </div> - </form> -
Added / After Commit
+ <input + type="file" + name="user_img" + id="userImgInput" + accept="image/jpeg,image/png,image/webp" + class="border border-gray-300 rounded-md outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent block w-full rounded-md text-sm text-gray-700 outline-none file:mr-4 file:rounded-md file:border-0 file:bg-[#0b3dba] file:px-4 file:py-2 file:text-sm file:font-semibold file:text-white focus:ring-2 focus:ring-blue-400 focus:border-transparent" /> + <p class="text-xs text-gray-400">JPG, PNG, or WEBP. Max 2MB.</p> + </div> + <div class="w-40 ms-2"> + @if ($profile?->user_img) + <img id="userImgPreview" src="{{ asset($profile->user_img) }}" alt="{{ old('name', $profile?->name) ?: $user->username }}" class="h-24 w-24 rounded-2xl border-2 border-[#0b3dba] object-cover" /> + @else + <img id="userImgPreview" src="" alt="{{ old('name', $profile?->name) ?: $user->username }}" class="hidden h-24 w-24 rounded-2xl border-2 border-[#0b3dba] object-cover" /> + <div id="userImgPlaceholder" class="h-24 w-24 rounded-2xl border-2 border-[#0b3dba] bg-white flex items-center justify-center text-[#0b3dba]"> + <i class="fa-solid fa-user text-2xl"></i> + </div> + @endif + </div>
Removed / Before Commit
- $profileData = [ - 'image' => $profile?->user_img ?: null, - 'name' => $profile?->name ?: $user->username ?: '-', - 'subtitle' => $profile?->destination ?: '-', - 'location' => $profile?->location ?: '-', - 'email' => $user->email ?: '-',
Added / After Commit
+ $profileData = [ + 'image' => $profile?->user_img ?: null, + 'name' => $profile?->name ?: $user->username ?: '-', + 'username' => $user->username ?: '-', + 'subtitle' => $profile?->destination ?: '-', + 'location' => $profile?->location ?: '-', + 'email' => $user->email ?: '-',
Removed / Before Commit
- const closeModal = (modal) => { - modal?.classList.add('hidden'); - document.body.classList.remove('overflow-hidden'); - }; - - document.addEventListener('click', (event) => {
Added / After Commit
+ const closeModal = (modal) => { + modal?.classList.add('hidden'); + document.body.classList.remove('overflow-hidden'); + modal?.querySelector('form')?.reset(); + modal?.querySelectorAll('[data-error-message]').forEach((el) => el.remove()); + }; + + document.addEventListener('click', (event) => {
Removed / Before Commit
- <tr> - <td style="padding:0 40px 20px;"> - <div style="text-align:center;"> - <a href="{{ config('app.url') }}" style="display:inline-block;text-decoration:none;font-family:'Basic',Arial,sans-serif;text-transform:uppercase;background:#0b3dba; padding:10px 30px; border-radius:10px; color:#fff; border:1px solid #0b3dba; margin:0 auto;">Visit Avriti</a> - </div> - </td> - </tr>
Added / After Commit
+ <tr> + <td style="padding:0 40px 20px;"> + <div style="text-align:center;"> + <a href="https://avriti.digitalmission.in/" style="display:inline-block;text-decoration:none;font-family:'Basic',Arial,sans-serif;text-transform:uppercase;background:#0b3dba; padding:10px 30px; border-radius:10px; color:#fff; border:1px solid #0b3dba; margin:0 auto;">Visit Avriti</a> + </div> + </td> + </tr>
Removed / Before Commit
- <div style="font-size:12px; font-weight:700; color:#0b3dba; margin-bottom:8px;">📦 Shipping Address</div> - <div style="font-size:12px; font-weight:600; color:#1a1a1a; margin-bottom:4px;">{{ $shipping_addr['full_name'] ?? $billing['full_name'] ?? 'Customer' }}</div> - <div style="font-size:11px; color:#666; line-height:1.8;"> - {{ $shipping_addr['phone'] ?? $billing['phone'] ?? '-' }}<br> - {{ $shipping_addr['address_line1'] ?? $billing['address_line1'] ?? '-' }}@if(!empty($shipping_addr['address_line2'] ?? $billing['address_line2'])), {{ $shipping_addr['address_line2'] ?? $billing['address_line2'] }}@endif<br> - {{ $shipping_addr['city'] ?? $billing['city'] ?? '-' }}, {{ $shipping_addr['state'] ?? $billing['state'] ?? '-' }}<br> - {{-- CTA BUTTON --}} - <tr> - <td align="center" style="padding:0 24px 28px;"> - <a href="{{ url('/') }}" style="display:inline-block; background:linear-gradient(135deg,#0b3dba,#1a56e8); color:#ffffff; font-size:14px; font-weight:600; text-decoration:none; padding:13px 36px; border-radius:50px; letter-spacing:0.3px;"> - Continue Shopping → - </a> - </td>
Added / After Commit
+ <div style="font-size:12px; font-weight:700; color:#0b3dba; margin-bottom:8px;">📦 Shipping Address</div> + <div style="font-size:12px; font-weight:600; color:#1a1a1a; margin-bottom:4px;">{{ $shipping_addr['full_name'] ?? $billing['full_name'] ?? 'Customer' }}</div> + <div style="font-size:11px; color:#666; line-height:1.8;"> + {{ $shipping_addr['email'] ?? $orderData['shipping_email'] ?? '-' }}<br> + {{ $shipping_addr['phone'] ?? $billing['phone'] ?? '-' }}<br> + {{ $shipping_addr['address_line1'] ?? $billing['address_line1'] ?? '-' }}@if(!empty($shipping_addr['address_line2'] ?? $billing['address_line2'])), {{ $shipping_addr['address_line2'] ?? $billing['address_line2'] }}@endif<br> + {{ $shipping_addr['city'] ?? $billing['city'] ?? '-' }}, {{ $shipping_addr['state'] ?? $billing['state'] ?? '-' }}<br> + {{-- CTA BUTTON --}} + <tr> + <td align="center" style="padding:0 24px 28px;"> + <a href="https://avriti.digitalmission.in/shop/" style="display:inline-block; background:linear-gradient(135deg,#0b3dba,#1a56e8); color:#ffffff; font-size:14px; font-weight:600; text-decoration:none; padding:13px 36px; border-radius:50px; letter-spacing:0.3px;"> + Continue Shopping → + </a> + </td>
Removed / Before Commit
- <span class="block lg:hidden text-xl font-bold tracking-tight"> - <img src="{{ asset('img/logo1.png') }}" class="invert brightness-0 w-[100px]" /> - </span> - <div class="hidden md:flex items-center gap-2 bg-gray-100 rounded-full px-4 py-2 md:w-72"> - <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg> - <input type="text" placeholder="Search..." class="bg-transparent text-sm text-gray-600 placeholder-gray-400 outline-none w-full"/> - </div> - </div> - - <!-- Right: flags, icons, avatar -->
Added / After Commit
+ <span class="block lg:hidden text-xl font-bold tracking-tight"> + <img src="{{ asset('img/logo1.png') }}" class="invert brightness-0 w-[100px]" /> + </span> + <!-- <div class="hidden md:flex items-center gap-2 bg-gray-100 rounded-full px-4 py-2 md:w-72"> + <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg> + <input type="text" placeholder="Search..." class="bg-transparent text-sm text-gray-600 placeholder-gray-400 outline-none w-full"/> + </div> --> + </div> + + <!-- Right: flags, icons, avatar -->
Removed / Before Commit
- Orders - </a> - - <a href="{{ route('tax-settings.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('tax-settings.*') ? $activeClass : $inactiveClass }}"> - <i class="fa-solid fa-percent"></i> - Tax Settings
Added / After Commit
+ Orders + </a> + + <a href="{{ route('transactions.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('transactions.*') ? $activeClass : $inactiveClass }}"> + <i class="fa-solid fa-money-bill-transfer"></i> + Transactions + </a> + + <a href="{{ route('tax-settings.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('tax-settings.*') ? $activeClass : $inactiveClass }}"> + <i class="fa-solid fa-percent"></i> + Tax Settings
Removed / Before Commit
- Route::delete('/users/{user}', [AdminUserController::class, 'destroy'])->name('users.destroy'); - - Route::get('/orders', [AdminOrderController::class, 'index'])->name('orders.index'); - Route::get('/orders/{order}', [AdminOrderController::class, 'show'])->name('orders.show'); - Route::patch('/orders/{order}/status', [AdminOrderController::class, 'updateStatus'])->name('orders.updateStatus'); - Route::view('/return-refund', 'admin.return-refund')->name('return-refund.index');
Added / After Commit
+ Route::delete('/users/{user}', [AdminUserController::class, 'destroy'])->name('users.destroy'); + + Route::get('/orders', [AdminOrderController::class, 'index'])->name('orders.index'); + Route::get('/transactions', [AdminOrderController::class, 'transactions'])->name('transactions.index'); + Route::get('/orders/{order}', [AdminOrderController::class, 'show'])->name('orders.show'); + Route::patch('/orders/{order}/status', [AdminOrderController::class, 'updateStatus'])->name('orders.updateStatus'); + Route::view('/return-refund', 'admin.return-refund')->name('return-refund.index');