Showing AI reviews for avriti-backend
Project AI Score ?
59%
Quality Avg ?
64%
Security Avg ?
45%
Reviews ?
57

Review Result ?

jattin01/avriti-backend · 18970eb2
The commit contains a large addition of environment variables including sensitive credentials in the .env file, which is a security risk. The controllers added show standard CRUD and view logic for admin management of customers and orders, which adds business value but with moderate quality due to missing comments and lack of validation detail. Some sensitive information exposure and duplication in .env indicates lower security and quality. The commit message is uninformative, reflecting a simple merge rather than descriptive purpose.
Quality ?
60%
Security ?
10%
Business Value ?
40%
Maintainability ?
60%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Sensitive Key Exposed
Where .env:3
Issue / Evidence sensitive key exposed
Suggested Fix remove secret keys and passwords from public commits and use environment-specific configs
Database Password Exposure
Where .env:38
Issue / Evidence database password exposure
Suggested Fix do not commit real passwords; use environment variable management
Mail Username Exposure
Where .env:79
Issue / Evidence mail username exposure
Suggested Fix do not commit personal email usernames and passwords
Mail Password Exposure
Where .env:80
Issue / Evidence mail password exposure
Suggested Fix do not commit credentials in repository
Duplicate Logic
Where .env:47
Issue / Evidence duplicated session settings
Suggested Fix remove duplicate session configuration to reduce confusion
Uninformative Merge Message
Where commit message
Issue / Evidence uninformative merge message
Suggested Fix use descriptive commit messages explaining purpose of changes
Missing Validation
Where app/Http/Controllers/AdminCustomerController.php:32
Issue / Evidence limited validation coverage
Suggested Fix consider adding more validation rules and checks to improve data integrity
Eager Loading Multiple Relations Without S...
Where app/Http/Controllers/AdminCustomerController.php:21
Issue / Evidence eager loading multiple relations without scope
Suggested Fix consider optimizing query scopes or limiting loaded relations if possible
Eager Loading Without Select
Where app/Http/Controllers/AdminOrderController.php:12
Issue / Evidence eager loading without select
Suggested Fix filter columns to improve performance
Lacks Comments
Where app/Http/Controllers/AdminUserController.php:53
Issue / Evidence lacks comments
Suggested Fix add descriptive comments to improve maintainability
Missing Validation
Where app/Http/Controllers/Api/AddressController.php:49
Issue / Evidence limited validation
Suggested Fix strengthen validation rules for input parameters
Code Change Preview · .env ?
Removed / Before Commit

                                                
Added / After Commit
+ APP_NAME=Laravel
+ APP_ENV=local
+ APP_KEY=base64:YkLfLJ78zljyLuLqC2wnmybild13CNeNzhXDOGCDc4g=
+ APP_DEBUG=true
+ # APP_URL=http://localhost
+ APP_URL=https://api.digitalmission.in
+ FRONTEND_URL=https://avriti.digitalmission.in
+ # FRONTEND_URL=http://localhost:3000
+ 
+ APP_LOCALE=en
+ APP_FALLBACK_LOCALE=en
+ APP_FAKER_LOCALE=en_US
+ 
+ APP_MAINTENANCE_DRIVER=file
+ # APP_MAINTENANCE_STORE=database
+ 
+ # PHP_CLI_SERVER_WORKERS=4
+ 
Removed / Before Commit
- MAIL_FROM_ADDRESS="hello@example.com"
- MAIL_FROM_NAME="${APP_NAME}"
- 
- AWS_ACCESS_KEY_ID=
- AWS_SECRET_ACCESS_KEY=
- AWS_DEFAULT_REGION=us-east-1
Added / After Commit
+ MAIL_FROM_ADDRESS="hello@example.com"
+ MAIL_FROM_NAME="${APP_NAME}"
+ 
+ 
+ 
+ 
+ AWS_ACCESS_KEY_ID=
+ AWS_SECRET_ACCESS_KEY=
+ AWS_DEFAULT_REGION=us-east-1
Removed / Before Commit
- *.log
- .DS_Store
- .env
- .env.backup
- .env.production
- .phpactor.json
- .phpunit.result.cache
- /.fleet
Added / After Commit
+ *.log
+ .DS_Store
+ # .env
+ # .env.backup
+ # .env.production
+ .phpactor.json
+ .phpunit.result.cache
+ /.fleet
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Customer;
+ use Illuminate\Http\RedirectResponse;
+ use Illuminate\Http\Request;
+ use Illuminate\View\View;
+ 
+ class AdminCustomerController extends Controller
+ {
+     public function index(): View
+     {
+         $customers = Customer::latest()->get();
+ 
+         return view('admin.customers', compact('customers'));
+     }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers;
+ 
+ use App\Models\Order;
+ use Illuminate\View\View;
+ 
+ class AdminOrderController extends Controller
+ {
+     public function index(): View
+     {
+         $orders = Order::with(['customer', 'items'])
+             ->latest()
+             ->get();
+ 
+         return view('admin.orders', compact('orders'));
+     }
+ 
Removed / Before Commit
- 'attributes.*.critical_qty' => ['nullable', 'integer', 'min:0'],
- 'attributes.*.sku' => ['nullable', 'string', 'max:255'],
- 'attributes.*.in_stock' => ['nullable', 'boolean'],
-                 'how_to_use' => ['nullable', 'string'],
- 'existing_thumbnails' => ['nullable', 'array'],
- 'existing_thumbnails.*' => ['nullable', 'string'],
- 'thumbnail' => ['nullable', 'array'],
- 'short_description' => $validated['short_description'] ?? null,
- 'description' => $validated['description'] ?? null,
- 'best_for' => $this->cleanRows($validated['best_for'] ?? []),
-             'how_to_use' => $validated['how_to_use'] ?? null,
- 'includes' => $this->cleanRows($validated['includes'] ?? []),
- 'attributes' => $this->cleanAttributeRows($validated['attributes'] ?? []),
- 'thumbnail' => $this->cleanImagePaths($thumbnailPaths),
Added / After Commit
+ 'attributes.*.critical_qty' => ['nullable', 'integer', 'min:0'],
+ 'attributes.*.sku' => ['nullable', 'string', 'max:255'],
+ 'attributes.*.in_stock' => ['nullable', 'boolean'],
+                 'how_to_use' => ['nullable', 'array'],
+                 'how_to_use.*' => ['nullable', 'string', 'max:255'],
+ 'existing_thumbnails' => ['nullable', 'array'],
+ 'existing_thumbnails.*' => ['nullable', 'string'],
+ 'thumbnail' => ['nullable', 'array'],
+ 'short_description' => $validated['short_description'] ?? null,
+ 'description' => $validated['description'] ?? null,
+ 'best_for' => $this->cleanRows($validated['best_for'] ?? []),
+             'how_to_use' => $this->cleanRows($validated['how_to_use'] ?? []),
+ 'includes' => $this->cleanRows($validated['includes'] ?? []),
+ 'attributes' => $this->cleanAttributeRows($validated['attributes'] ?? []),
+ 'thumbnail' => $this->cleanImagePaths($thumbnailPaths),
Removed / Before Commit
- ]);
- }
- 
- public function update(Request $request, User $user): RedirectResponse
- {
- $validated = $request->validate([
Added / After Commit
+ ]);
+ }
+ 
+     public function show(User $user): View
+     {
+         $user->load('profile');
+ 
+         return view('admin.user-profile', [
+             'user' => $user,
+             'profile' => $user->profile,
+         ]);
+     }
+ 
+ public function update(Request $request, User $user): RedirectResponse
+ {
+ $validated = $request->validate([
Removed / Before Commit
- use App\Http\Controllers\Controller;
- use App\Models\Address;
- use Illuminate\Http\Request;
- use Illuminate\Http\JsonResponse;
- 
- class AddressController extends Controller
- {
- $request->validate([
- 'full_name'    => ['required', 'string'],
- 'phone'        => ['required', 'string'],
- 'address_line1'=> ['required', 'string'],
- 'city'         => ['required', 'string'],
- 'state'        => ['required', 'string'],
- }
- 
- $address = Address::create([
-             ...$request->only(['full_name','phone','address_line1','address_line2','landmark','city','state','pincode','country','address_type']),
- 'customer_id' => $customerId,
Added / After Commit
+ use App\Http\Controllers\Controller;
+ use App\Models\Address;
+ use Illuminate\Http\Request;
+ 
+ class AddressController extends Controller
+ {
+ $request->validate([
+ 'full_name'    => ['required', 'string'],
+ 'phone'        => ['required', 'string'],
+             'email'        => ['nullable', 'email'],
+ 'address_line1'=> ['required', 'string'],
+ 'city'         => ['required', 'string'],
+ 'state'        => ['required', 'string'],
+ }
+ 
+ $address = Address::create([
+             ...$request->only(['full_name','phone','email','address_line1','address_line2','landmark','city','state','pincode','country','address_type']),
+ 'customer_id' => $customerId,
Removed / Before Commit
- {
- public function index(Request $request): JsonResponse
- {
-         $items = CartItem::with('product')
- ->where('customer_id', $request->user()->id)
- ->get()
- ->map(fn($item) => $this->formatItem($item));
- $request->validate([
- 'product_id'      => ['required', 'integer', 'exists:products,id'],
- 'attribute_name'  => ['nullable', 'string'],
-             'attribute_value' => ['nullable', 'numeric'],
- 'quantity'        => ['integer', 'min:1'],
- ]);
- 
- ->where('attribute_name', $request->attribute_name)
- ->first();
- 
- if ($existing) {
Added / After Commit
+ {
+ public function index(Request $request): JsonResponse
+ {
+         $items = CartItem::with('product.variant')
+ ->where('customer_id', $request->user()->id)
+ ->get()
+ ->map(fn($item) => $this->formatItem($item));
+ $request->validate([
+ 'product_id'      => ['required', 'integer', 'exists:products,id'],
+ 'attribute_name'  => ['nullable', 'string'],
+             'attribute_value' => ['nullable', 'string'],
+ 'quantity'        => ['integer', 'min:1'],
+ ]);
+ 
+ ->where('attribute_name', $request->attribute_name)
+ ->first();
+ 
+         // resolve variant_id, sku, price from product attributes
Removed / Before Commit
- namespace App\Http\Controllers\Api;
- 
- use App\Http\Controllers\Controller;
- use App\Models\Contact;
- use Illuminate\Http\Request;
- 
- class ContactController extends Controller
- {
- 'message' => 'required|string',
- ]);
- 
-         Contact::create([
- 'name'    => $request->name,
- 'email'   => $request->email,
- 'phone'   => $request->phone,
- 'message' => $request->message,
- ]);
- 
Added / After Commit
+ namespace App\Http\Controllers\Api;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Mail\ContactAdminMail;
+ use App\Mail\ContactUserMail;
+ use App\Models\Contact;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\Mail;
+ 
+ class ContactController extends Controller
+ {
+ 'message' => 'required|string',
+ ]);
+ 
+         $contact = Contact::create([
+ 'name'    => $request->name,
+ 'email'   => $request->email,
+ 'phone'   => $request->phone,
Removed / Before Commit
- namespace App\Http\Controllers\Api;
- 
- use App\Http\Controllers\Controller;
- use App\Models\Customer;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Hash;
- use Illuminate\Support\Str;
- use Illuminate\Validation\ValidationException;
- 
- $request->validate([
- 'full_name' => ['required', 'string', 'max:150'],
- 'email'     => ['required', 'email', 'unique:customers,email'],
-         'phone'     => ['nullable', 'string', 'max:20'],
- 'password'  => ['required', 'string', 'min:8'],
- ]);
- 
Added / After Commit
+ namespace App\Http\Controllers\Api;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Mail\CustomerRegistrationMail;
+ use App\Mail\CustomerResetPasswordMail;
+ use App\Mail\CustomerWelcomeMail;
+ use App\Models\Customer;
+ use Illuminate\Http\JsonResponse;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Facades\Hash;
+ use Illuminate\Support\Facades\Mail;
+ use Illuminate\Support\Str;
+ use Illuminate\Validation\ValidationException;
+ 
+ $request->validate([
+ 'full_name' => ['required', 'string', 'max:150'],
+ 'email'     => ['required', 'email', 'unique:customers,email'],
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers\Api;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Models\Order;
+ use Illuminate\Http\JsonResponse;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\File;
+ use Illuminate\Validation\Rule;
+ 
+ class CustomerProfileController extends Controller
+ {
+     public function show(Request $request): JsonResponse
+     {
+         return response()->json([
+             'success' => true,
+             'data' => $this->profileData($request),
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers\Api;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Mail\OrderPlacedMail;
+ use App\Models\Order;
+ use App\Models\CartItem;
+ use App\Models\Product;
+ use Illuminate\Http\JsonResponse;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\Mail;
+ use Illuminate\Support\Str;
+ 
+ class OrderController extends Controller
+ {
+     public function store(Request $request): JsonResponse
+     {
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers\Api;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Models\Product;
+ use App\Models\Wishlist;
+ use Illuminate\Http\JsonResponse;
+ use Illuminate\Http\Request;
+ 
+ class WishlistController extends Controller
+ {
+     public function index(Request $request): JsonResponse
+     {
+         $items = Wishlist::with('product.variant', 'product.category')
+             ->where('customer_id', $request->user()->id)
+             ->latest()
+             ->get()
Removed / Before Commit
- 'password' => ['required', 'string', 'min:8'],
- ]);
- 
-         $user = User::create($validated);
- $user->profile()->create();
- 
-         Auth::login($user);
-         $request->session()->regenerate();
- 
-         return redirect()->route('dashboard');
- }
- 
- public function login(Request $request): RedirectResponse
- ]);
- }
- 
- $request->session()->regenerate();
- 
Added / After Commit
+ 'password' => ['required', 'string', 'min:8'],
+ ]);
+ 
+         $user = User::create([
+             ...$validated,
+             'is_active' => false,
+         ]);
+ $user->profile()->create();
+ 
+         return redirect()
+             ->route('login')
+             ->with('status', 'Account pending approval. Please login after admin activation.');
+ }
+ 
+ public function login(Request $request): RedirectResponse
+ ]);
+ }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use App\Models\Contact;
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class ContactAdminMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public Contact $contact
+     ) {
+     }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use App\Models\Contact;
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class ContactUserMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public Contact $contact
+     ) {
+     }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use App\Models\Customer;
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class CustomerRegistrationMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public Customer $customer
+     ) {
+     }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class CustomerResetPasswordMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public string $email,
+         public string $token,
+         public ?string $name = null
+     ) {
+     }
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use App\Models\Customer;
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class CustomerWelcomeMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public Customer $customer
+     ) {
+     }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Mail;
+ 
+ use Illuminate\Bus\Queueable;
+ use Illuminate\Mail\Mailable;
+ use Illuminate\Queue\SerializesModels;
+ 
+ class OrderPlacedMail extends Mailable
+ {
+     use Queueable, SerializesModels;
+ 
+     public function __construct(
+         public array $orderData
+     ) {
+     }
+ 
+     public function build(): self
Removed / Before Commit
- class Address extends Model
- {
- protected $fillable = [
-         'customer_id', 'full_name', 'phone', 'address_line1', 'address_line2',
- 'landmark', 'city', 'state', 'pincode', 'country', 'address_type', 'is_default',
- ];
Added / After Commit
+ class Address extends Model
+ {
+ protected $fillable = [
+         'customer_id', 'full_name', 'phone', 'email', 'address_line1', 'address_line2',
+ 'landmark', 'city', 'state', 'pincode', 'country', 'address_type', 'is_default',
+ ];
Removed / Before Commit
- protected $fillable = [
- 'customer_id',
- 'product_id',
- 'attribute_name',
- 'attribute_value',
- 'quantity',
- ];
- 
- public function product(): BelongsTo
- {
- return $this->belongsTo(Product::class);
- }
- }
Added / After Commit
+ protected $fillable = [
+ 'customer_id',
+ 'product_id',
+         'variant_id',
+ 'attribute_name',
+ 'attribute_value',
+         'sku',
+         'price',
+ 'quantity',
+         'subtotal',
+ ];
+ 
+ public function product(): BelongsTo
+ {
+ return $this->belongsTo(Product::class);
+ }
+ 
+     public function variant(): BelongsTo
Removed / Before Commit
- namespace App\Models;
- 
- use Illuminate\Foundation\Auth\User as Authenticatable;
- use Laravel\Sanctum\HasApiTokens;
- 
- class Customer extends Authenticatable
- {
- use HasApiTokens;
- 
-    protected $fillable = ['full_name', 'email', 'phone', 'password'];
- 
- protected $hidden = ['password'];
- 
- protected function casts(): array
- {
-         return ['password' => 'hashed'];
- }
- }
Added / After Commit
+ namespace App\Models;
+ 
+ use Illuminate\Foundation\Auth\User as Authenticatable;
+ use Illuminate\Database\Eloquent\Relations\HasMany;
+ use Laravel\Sanctum\HasApiTokens;
+ 
+ class Customer extends Authenticatable
+ {
+ use HasApiTokens;
+ 
+     protected $fillable = ['full_name', 'email', 'phone', 'profile_img', 'is_active', 'password'];
+ 
+ protected $hidden = ['password'];
+ 
+ protected function casts(): array
+ {
+         return [
+             'is_active' => 'boolean',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Database\Eloquent\Relations\HasMany;
+ use Illuminate\Database\Eloquent\Relations\BelongsTo;
+ 
+ class Order extends Model
+ {
+     protected $fillable = [
+         'order_number',
+         'customer_id',
+         'shipping_address_id',
+         'billing_address_id',
+         'shipping_address_json',
+         'billing_address_json',
+         'shipping_email',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Database\Eloquent\Relations\BelongsTo;
+ 
+ class OrderItem extends Model
+ {
+     protected $fillable = [
+         'order_id',
+         'product_id',
+         'variant_id',
+         'product_name',
+         'variant_name',
+         'attribute_name',
+         'attribute_value',
+         'sku',
Removed / Before Commit
- {
- return [
- 'best_for' => 'array',
- 'includes' => 'array',
- 'attributes' => 'array',
- 'thumbnail' => 'array',
Added / After Commit
+ {
+ return [
+ 'best_for' => 'array',
+             'how_to_use' => 'array',
+ 'includes' => 'array',
+ 'attributes' => 'array',
+ 'thumbnail' => 'array',
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Database\Eloquent\Relations\BelongsTo;
+ 
+ class Wishlist extends Model
+ {
+     protected $fillable = [
+         'customer_id',
+         'product_id',
+         'attribute_name',
+         'attribute_value',
+     ];
+ 
+     public function product(): BelongsTo
+     {
Removed / Before Commit
- 'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')),
- ],
- 
- ];
Added / After Commit
+ 'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')),
+ ],
+ 
+     'admin_address' => env('ADMIN_MAIL'),
+ 
+ ];
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('addresses', function (Blueprint $table) {
+             $table->string('email')->nullable()->after('phone');
+         });
+     }
+ 
+     public function down(): void
+     {
+         Schema::table('addresses', function (Blueprint $table) {
Removed / Before Commit
- \ No newline at end of file
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('cart_items', function (Blueprint $table) {
+ 
+             $table->unsignedBigInteger('variant_id')
+                   ->nullable()
+                   ->after('product_id');
+ 
+             $table->string('sku')
+                   ->nullable()
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
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('orders', function (Blueprint $table) {
+             $table->id();
+             $table->string('order_number')->unique();
+             $table->foreignId('customer_id')->constrained('customers')->onDelete('cascade');
+ 
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
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::create('order_items', function (Blueprint $table) {
+             $table->id();
+             $table->foreignId('order_id')->constrained('orders')->onDelete('cascade');
+ 
+             $table->unsignedBigInteger('product_id')->nullable();
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::create('wishlists', function (Blueprint $table) {
+             $table->id();
+             $table->foreignId('customer_id')->constrained('customers')->onDelete('cascade');
+             $table->foreignId('product_id')->constrained('products')->onDelete('cascade');
+             $table->string('attribute_name')->nullable();
+             $table->string('attribute_value')->nullable();
+             $table->timestamps();
+ 
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('customers', function (Blueprint $table) {
+             $table->string('profile_img')->nullable()->after('phone');
+         });
+     }
+ 
+     public function down(): void
+     {
+         Schema::table('customers', function (Blueprint $table) {
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Support\Facades\DB;
+ 
+ return new class extends Migration
+ {
+     public function up(): void
+     {
+         DB::statement("UPDATE customers SET profile_img = REPLACE(profile_img, 'profile/', 'profile_img/') WHERE profile_img IS NOT NULL");
+     }
+ 
+     public function down(): void
+     {
+         DB::statement("UPDATE customers SET profile_img = REPLACE(profile_img, 'profile_img/', 'profile/') WHERE profile_img IS NOT NULL");
+     }
+ };
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('customers', function (Blueprint $table) {
+             $table->boolean('is_active')->default(true)->after('profile_img');
+         });
+     }
+ 
+     public function down(): void
+     {
+         Schema::table('customers', function (Blueprint $table) {
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         DB::table('products')->whereNotNull('how_to_use')->where('how_to_use', '!=', '')->get(['id', 'how_to_use'])->each(function ($product) {
+             if (str_starts_with(trim($product->how_to_use), '[')) {
+                 return;
+             }
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ use Illuminate\Database\Migrations\Migration;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Facades\Schema;
+ 
+ return new class extends Migration
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         // existing 'upi' / 'card' rows have no value left to map to once those
+         // enum options are removed — fall back to 'cod' so no data is lost.
+         DB::table('orders')
+             ->whereIn('payment_method', ['upi', 'card'])
+             ->update(['payment_method' => 'cod']);
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
+ {
+     /**
+      * Run the migrations.
+      */
+     public function up(): void
+     {
+         Schema::table('orders', function (Blueprint $table) {
+             $table->string('razorpay_order_id')->nullable()->after('payment_method');
+             $table->string('razorpay_payment_id')->nullable()->after('razorpay_order_id');
+             $table->string('razorpay_signature')->nullable()->after('razorpay_payment_id');
+         });
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
+     {
+         DB::statement("ALTER TABLE cart_items MODIFY attribute_value VARCHAR(255) NULL");
+     }
+ 
+     public function down(): void
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ require dirname(__DIR__) . '/index.php';
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Edit Customer | 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]">Edit Customer</h1>
+     <p class="mt-2 text-sm text-gray-500">Update account information.</p>
+   </div>
+   <a href="{{ route('customers.index') }}" class="inline-flex h-11 items-center justify-center rounded-full border border-gray-200 bg-white px-5 text-sm font-semibold text-gray-600 shadow-sm transition hover:bg-gray-50">
+     Back
+   </a>
+ </div>
+ 
+ @php
+   $displayName = old('full_name', $customer->full_name) ?: 'Customer';
+ @endphp
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Customer Profile | Avriti Dashboard')
+ @section('content')
+ 
+ @php
+   $displayName = $customer->full_name ?: 'Customer';
+   $defaultAddress = $customer->addresses->firstWhere('is_default', true) ?? $customer->addresses->first();
+   $totalOrders = $customer->orders->count();
+   $totalSpent = $customer->orders->sum('total_amount');
+ @endphp
+ 
+ <div class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
+   <h1 class="text-2xl font-semibold text-[#0b3dba]">Customer Profile</h1>
+   <a href="{{ route('customers.index') }}" class="inline-flex h-11 items-center justify-center rounded-full border border-gray-200 bg-white px-5 text-sm font-semibold text-gray-600 shadow-sm transition hover:bg-gray-50">
+     <i class="fa-solid fa-arrow-left mr-2"></i> Back
+   </a>
+ </div>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Customers | 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]">Customers List</h1>
+           </div>
+         </div>
+ 
+         @if (session('success'))
+           <div class="mb-6 rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm font-semibold text-emerald-700">
+             {{ session('success') }}
+           </div>
+         @endif
+ 
+         <div class="overflow-hidden rounded-[32px] bg-white shadow-sm">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Order ' . $order->order_number . ' | Avriti Dashboard')
+ @section('content')
+ 
+ @php
+   $paymentStatus = strtoupper($order->payment_status ?: 'pending');
+   $paymentStatusClasses = match ($order->payment_status) {
+     'paid' => 'bg-emerald-100 text-emerald-600',
+     'failed' => 'bg-red-100 text-red-500',
+     'refunded' => 'bg-blue-100 text-blue-500',
+     default => 'bg-amber-100 text-amber-700',
+   };
+   $orderStatus = strtoupper($order->order_status ?: 'pending');
+   $orderStatusClasses = match ($order->order_status) {
+     'delivered' => 'bg-emerald-100 text-emerald-600',
+     'cancelled' => 'bg-red-100 text-red-500',
+     'returned' => 'bg-blue-100 text-blue-500',
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('title', 'Users | Avriti Dashboard')
- @section('content')
- 
-       <div class="bg-white rounded-2xl shadow-sm overflow-hidden">
- 
-     <!-- Table -->
-     <div class="overflow-x-auto">
- 
-       <table class="w-full text-sm text-left text-gray-600">
- 
-         <!-- Head -->
-         <thead class="bg-[#0b3dba] border-b border-gray-200 text-gray-500">
- 
-           <tr>
- 
-             <th class="px-5 py-4">
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Orders | Avriti Dashboard')
+ @section('content')
+ 
+ {{-- Hardcoded backup:
+ <tr>
+   <td>#TBT12</td>
+   <td>Louis Hicks</td>
+   <td>Leather band Smartwatches</td>
+   <td>$2145.20</td>
+   <td>11 Feb, 2021</td>
+   <td>COD</td>
+   <td><span class="px-3 py-1 rounded-md text-xs font-semibold bg-emerald-100 text-emerald-600">DELIVERED</span></td>
+   <td><button class="w-9 h-9 rounded-lg bg-violet-100 text-violet-500 text-lg font-bold">...</button></td>
+ </tr>
+ <tr>
+   <td>#TBT11</td>
Removed / Before Commit
- $variantValue = old('variant_id', $product?->variant_id);
- $bestForRows = old('best_for', $product?->best_for ?? []);
- $includeRows = old('includes', $product?->includes ?? []);
- $attributeRows = old('attributes', $product?->attributes ?? []);
- 
- if (! is_array($bestForRows)) {
- $includeRows = [];
- }
- 
- if (! is_array($attributeRows)) {
- $attributeRows = [];
- }
- $includeRows = [''];
- }
- 
- if ($attributeRows === []) {
- $attributeRows = [['name' => '', 'value' => '', 'mrp' => '', 'selling_price' => '', 'stock_qty' => '', 'critical_qty' => '', 'sku' => '', 'in_stock' => true]];
- }
Added / After Commit
+ $variantValue = old('variant_id', $product?->variant_id);
+ $bestForRows = old('best_for', $product?->best_for ?? []);
+ $includeRows = old('includes', $product?->includes ?? []);
+   $howToUseRows = old('how_to_use', $product?->how_to_use ?? []);
+ $attributeRows = old('attributes', $product?->attributes ?? []);
+ 
+ if (! is_array($bestForRows)) {
+ $includeRows = [];
+ }
+ 
+   if (! is_array($howToUseRows)) {
+     $howToUseRows = [];
+   }
+ 
+ if (! is_array($attributeRows)) {
+ $attributeRows = [];
+ }
+ $includeRows = [''];
Removed / Before Commit

                                                
Added / After Commit
+ @php
+   $profileData   = $profileData ?? [];
+   $image         = $profileData['image'] ?? null;
+   $name          = $profileData['name'] ?? '-';
+   $username      = $profileData['username'] ?? '-';
+   $subtitle      = $profileData['subtitle'] ?? '-';
+   $location      = $profileData['location'] ?? '-';
+   $email         = $profileData['email'] ?? '-';
+   $dateOfBirth   = $profileData['date_of_birth'] ?? '-';
+   $phone         = $profileData['phone'] ?? '-';
+   $totalReviews  = $profileData['total_reviews'] ?? 0;
+ @endphp
+ 
+ <div class="px-4 py-8 sm:px-6 lg:px-8">
+   <div class="mx-auto w-full max-w-7xl">
+     <div class="overflow-hidden rounded-[32px] bg-white shadow-xl shadow-slate-200/40">
+       <div class="grid gap-6 lg:grid-cols-[360px_minmax(0,1fr)] p-6">
+         <div class="rounded-[32px] bg-slate-50 p-4">
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('title', 'Products | Avriti Dashboard')
- @section('content')
- 
- @php
- @endsection
- 
- @push('scripts')
- <script>
- (() => {
- const openModal = (modal) => {
- setTimeout(() => alert.remove(), 500);
- }, 3500);
- });
- })();
- </script>
- @endpush
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Products | Avriti Dashboard')
+ 
+ @push('styles')
+ <link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet" />
+ @endpush
+ 
+ @section('content')
+ 
+ @php
+ @endsection
+ 
+ @push('scripts')
+ <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
+ <script>
+ (() => {
+ const openModal = (modal) => {
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('title', 'Users | Avriti Dashboard')
- @section('content')
- 
-         <div class="px-4 py-8 sm:px-6 lg:px-8">
-     <div class="mx-auto w-full max-w-7xl">
-       
- 
-       <div class="overflow-hidden rounded-[32px] bg-white shadow-xl shadow-slate-200/40">
-         <div class="grid gap-6 lg:grid-cols-[360px_minmax(0,1fr)] p-6">
-           <div class="rounded-[32px] bg-slate-50 p-4">
-             <img src="https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=720&q=80" alt="Profile photo" class="h-[480px] w-full rounded-[28px] object-cover shadow-inner shadow-slate-200/80" />
-           </div>
- 
-           <div class="flex flex-col  gap-6">
-             <div>
-               <div class="mb-6">
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Profile | Avriti Dashboard')
+ @section('content')
+ 
+ @php
+   $currentUser    = auth()->user();
+   $currentProfile = $currentUser?->profile;
+   $profileData    = [
+     'image'         => $currentProfile?->user_img ?: null,
+     'name'          => $currentProfile?->name ?: $currentUser?->username ?: '-',
+     'username'      => $currentUser?->username ?: '-',
+     'subtitle'      => $currentProfile?->destination ?: '-',
+     'location'      => $currentProfile?->location ?: '-',
+     'email'         => $currentUser?->email ?: '-',
+     'date_of_birth' => $currentProfile?->date_of_birth?->format('d M, Y') ?: '-',
+     'phone'         => $currentProfile?->phone_number ?: '-',
+     'total_reviews' => $currentProfile?->total_reviews ?? 0,
Removed / Before Commit
- 
- <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]">Edit User</h1>
- <p class="mt-2 text-sm text-gray-500">Update account and profile information.</p>
- </div>
- <a href="{{ route('users.index') }}" class="inline-flex h-11 items-center justify-center rounded-full border border-gray-200 bg-white px-5 text-sm font-semibold text-gray-600 shadow-sm transition hover:bg-gray-50">
Added / After Commit
+ 
+ <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]">Edit Admin</h1>
+ <p class="mt-2 text-sm text-gray-500">Update account and profile information.</p>
+ </div>
+ <a href="{{ route('users.index') }}" class="inline-flex h-11 items-center justify-center rounded-full border border-gray-200 bg-white px-5 text-sm font-semibold text-gray-600 shadow-sm transition hover:bg-gray-50">
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'User Profile | Avriti Dashboard')
+ @section('content')
+ 
+ @php
+   $profileData = [
+     'image'          => $profile?->user_img ?: null,
+     'name'           => $profile?->name ?: $user->username ?: '-',
+     'subtitle'       => $profile?->destination ?: '-',
+     'location'       => $profile?->location ?: '-',
+     'email'          => $user->email ?: '-',
+     'date_of_birth'  => $profile?->date_of_birth?->format('d M, Y') ?: '-',
+     'phone'          => $profile?->phone_number ?: '-',
+     'total_reviews'  => $profile?->total_reviews ?? 0,
+     'is_active'      => $user->is_active,
+     'created_at'     => $user->created_at?->format('d M, Y') ?: '-',
+   ];
Removed / Before Commit
- @extends('layouts.app')
- 
- @section('title', 'Users | 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]">Users List</h1>
- 
- </div>
- 
- <div class="overflow-hidden rounded-[32px] bg-white shadow-sm">
- <div class="flex flex-col gap-4 border-b border-gray-200 px-6 py-5 sm:flex-row sm:items-center sm:justify-between">
- <div class="flex flex-col gap-2 sm:flex-row sm:items-center">
-               <div class="rounded-2xl bg-[#eef4ff] px-4 py-3 text-sm font-semibold text-[#1a41b1]">{{ $users->count() }} {{ $users->count() === 1 ? 'User' : 'Users' }}</div>
-               <p class="text-sm text-gray-500">Latest created accounts shown below.</p>
- </div>
- <!-- <form method="GET" action="{{ route('users.index') }}" class="flex items-center gap-2">
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('title', 'Admins | 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]">Admin List</h1>
+ 
+ </div>
+ 
+ <div class="overflow-hidden rounded-[32px] bg-white shadow-sm">
+ <div class="flex flex-col gap-4 border-b border-gray-200 px-6 py-5 sm:flex-row sm:items-center sm:justify-between">
+ <div class="flex flex-col gap-2 sm:flex-row sm:items-center">
+               <div class="rounded-2xl bg-[#eef4ff] px-4 py-3 text-sm font-semibold text-[#1a41b1]">{{ $users->count() }} {{ $users->count() === 1 ? 'Admin' : 'Admins' }}</div>
+               <p class="text-sm text-gray-500">Latest created admins shown below.</p>
+ </div>
+ <!-- <form method="GET" action="{{ route('users.index') }}" class="flex items-center gap-2">
Removed / Before Commit
- <!-- Form -->
- <div class="p-8">
- 
- 
- <form method="POST" action="{{ route('login.store') }}" class="space-y-5">
- @csrf
- </div>
- 
- </div>
- @endsection
- \ No newline at end of file
Added / After Commit
+ <!-- Form -->
+ <div class="p-8">
+ 
+     @if (session('status'))
+       <div class="mb-5 rounded-md border border-amber-200 bg-amber-50 px-4 py-3 text-sm font-semibold text-amber-700">
+         {{ session('status') }}
+       </div>
+     @endif
+ 
+ <form method="POST" action="{{ route('login.store') }}" class="space-y-5">
+ @csrf
+ </div>
+ 
+ </div>
+ \ No newline at end of file
+ @endsection
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8">
+   <meta name="viewport" content="width=device-width, initial-scale=1.0">
+   <title>New Contact Enquiry</title>
+   <link href="https://fonts.googleapis.com/css2?family=Basic&display=swap" rel="stylesheet">
+ </head>
+ <body style="margin:0;padding:0;background:linear-gradient(135deg,#b8d4f0 0%,#d4c5e8 50%,#c8dff0 100%);font-family:'Basic',Arial,sans-serif;color:#1a1a1a;">
+   <table cellpadding="0" cellspacing="0" border="0" style="max-width:560px;width:92%;margin:24px auto;background:#ffffff;border-radius:18px;overflow:hidden;box-shadow:0 6px 24px rgba(11,61,186,.12);">
+     <tr>
+       <td align="center" style="padding:30px 20px 22px;">
+         <img src="{{ url('img/logo1.png') }}" alt="Avriti" style="max-width:150px;width:100%;">
+       </td>
+     </tr>
+     <tr>
+       <td align="center" style="background:#0b3dba;padding:28px 28px;color:#ffffff;">
+         <div style="display:inline-block;width:44px;height:44px;border-radius:50%;border:2px solid #c5d3f0;line-height:44px;font-size:22px;margin-bottom:12px;">✉</div>
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8">
+   <meta name="viewport" content="width=device-width, initial-scale=1.0">
+   <title>Thanks for Contacting Avriti</title>
+   <link href="https://fonts.googleapis.com/css2?family=Basic&display=swap" rel="stylesheet">
+ </head>
+ <body style="margin:0;padding:0;background:linear-gradient(135deg,#b8d4f0 0%,#d4c5e8 50%,#c8dff0 100%);font-family:'Basic',Arial,sans-serif;color:#1a1a1a;">
+   <table cellpadding="0" cellspacing="0" border="0" style="max-width:540px;width:92%;margin:24px auto;background:#ffffff;border-radius:18px;overflow:hidden;box-shadow:0 6px 24px rgba(11,61,186,.12);">
+     <tr>
+       <td align="center" style="padding:30px 20px 22px;">
+         <img src="{{ url('img/logo1.png') }}" alt="Avriti" style="max-width:150px;width:100%;">
+       </td>
+     </tr>
+     <tr>
+       <td align="center" style="background:#0b3dba;padding:30px 28px;color:#ffffff;">
+         <div style="display:inline-block;width:46px;height:46px;border-radius:50%;border:2px solid #22c55e;line-height:46px;font-size:24px;color:#22c55e;margin-bottom:12px;">✓</div>
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8" />
+   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+   <title>Registration</title>
+   <link href="https://fonts.googleapis.com/css2?family=Basic&display=swap" rel="stylesheet">
+ </head>
+ <body style="margin:0; padding:0; background:#f0f4f8; font-family: 'Basic', Arial, sans-serif;">
+   <table cellpadding="0" cellspacing="0" border="0" style="max-width:500px; width:90%; margin:20px auto;background-color:#ffffff; border-radius:12px; overflow:hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08);">
+     <tr>
+       <td align="center" style="padding: 30px 20px 20px 20px;">
+         <img src="{{ url('img/logo1.png') }}" alt="Avriti" style="max-width:150px; width:100%;">
+       </td>
+     </tr>
+     <tr>
+       <td style="padding: 0 20px 10px 20px; font-size:16px; color:#1a1a1a; font-weight:600;">
+         Hello <b style="color:#0b3dba;">{{ $customer->full_name }}</b>
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8" />
+   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+   <link href="https://fonts.googleapis.com/css2?family=Basic&display=swap" rel="stylesheet">
+   <title>Reset Password</title>
+ </head>
+ <body style="margin:0; padding:0; font-family: 'Basic', Arial, sans-serif; background:#f0f4f8;">
+   @php($resetUrl = rtrim(env('FRONTEND_URL', config('app.url')), '/') . '/reset-password?email=' . urlencode($email) . '&token=' . urlencode($token))
+   <table width="420" cellpadding="0" cellspacing="0" border="0" style="max-width:500px; width:90%; margin:20px auto;background-color:#ffffff; border-radius:16px; overflow:hidden; box-shadow:0 4px 20px rgba(0,0,0,0.08);">
+     <tr><td align="center" style="padding: 30px 20px 0 20px;"><img src="{{ url('img/logo1.png') }}" alt="Avriti" style="max-width:150px; width:100%;"></td></tr>
+     <tr>
+       <td align="center" style="padding:40px 40px 30px 40px;">
+         <div style="font-size:64px; line-height:1; margin-bottom:6px;">📧🔒</div>
+         <div style="font-size:22px; font-weight:700; color:#1a1a1a; margin-top:20px;">Reset password</div>
+         <div style="font-size:14px; color:#0b3dba; font-weight:600; margin-top:16px;">Hey {{ $name ?: 'Customer' }},</div>
+         <div style="font-size:13px; color:#555555; margin-top:10px; line-height:1.7; text-align:center; max-width:300px; margin-left:auto; margin-right:auto;">You're receiving this e-mail because you requested a password reset for your account.</div>
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8" />
+   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+   <title>Welcome to Avriti</title>
+   <link href="https://fonts.googleapis.com/css2?family=Basic&display=swap" rel="stylesheet">
+ </head>
+ <body style="margin:0; padding:0; background:#f0f4f8; font-family: 'Basic', Arial, sans-serif;">
+   <table cellpadding="0" cellspacing="0" border="0" style="max-width:500px; width:90%; margin:20px auto;background-color:#ffffff; border-radius:12px; overflow:hidden; box-shadow:0 2px 10px rgba(0,0,0,0.07);">
+     <tr><td align="center" style="padding: 30px 20px 20px 20px;"><img src="{{ url('img/logo1.png') }}" alt="Avriti" style="max-width:150px; width:100%;"></td></tr>
+     <tr>
+       <td style="padding:0 40px 24px 40px;">
+         <table width="100%" cellpadding="0" cellspacing="0" border="0" style="background-color:#0b3dba; border-radius:12px;">
+           <tr><td align="center" style="padding: 20px;"><img src="{{ url('img/welcome.png') }}" alt="Welcome" style="max-width:100%;border-radius:12px;"></td></tr>
+         </table>
+       </td>
+     </tr>
Removed / Before Commit

                                                
Added / After Commit
+ @php
+   $items = $orderData['items'] ?? [];
+   $billing = $orderData['billing_address'] ?? [];
+   $shipping_addr = $orderData['shipping_address'] ?? [];
+   $itemsCount = count($items);
+   $subtotal = (float) ($orderData['subtotal'] ?? 0);
+   $tax = (float) ($orderData['tax'] ?? 0);
+   $shippingCost = (float) ($orderData['shipping'] ?? 0);
+   $total = (float) ($orderData['total'] ?? 0);
+   $fallbackImage = url('img/logo1.png');
+ @endphp
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+   <meta charset="UTF-8"/>
+   <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+   <title>Order Confirmation</title>
+   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
Removed / Before Commit
- <!-- Right: flags, icons, avatar -->
- <div class="flex items-center gap-3">
- <!-- Avatar -->
-     <div class="flex items-center gap-2 cursor-pointer">
-       @if ($headerImage)
-         <img src="{{ asset($headerImage) }}" alt="{{ $headerUser->username ?? 'User' }}" class="w-9 h-9 rounded-full border-2 border-[#0b3dba] object-cover bg-gray-100"/>
-       @else
-         <div class="w-9 h-9 rounded-full border-2 border-[#0b3dba] flex items-center justify-center bg-gray-100 text-gray-600">
-           <i class="fa-solid fa-user"></i>
- </div>
-       @endif
-       <div class="leading-tight">
-         <p class="text-sm font-semibold text-white lg:text-gray-800">{{ $headerUser->username ?? 'User' }}</p>
-         <p class="text-xs text-gray-400">{{ $headerUser->email ?? 'Master' }}</p>
- </div>
-       <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M19 9l-7 7-7-7"/></svg>
- </div>
- <form method="POST" action="{{ route('logout') }}">
Added / After Commit
+ <!-- Right: flags, icons, avatar -->
+ <div class="flex items-center gap-3">
+ <!-- Avatar -->
+     <div class="relative" data-user-menu>
+       <button type="button" data-user-menu-toggle class="flex items-center gap-2 cursor-pointer">
+         @if ($headerImage)
+           <img src="{{ asset($headerImage) }}" alt="{{ $headerUser->username ?? 'User' }}" class="w-9 h-9 rounded-full border-2 border-[#0b3dba] object-cover bg-gray-100"/>
+         @else
+           <div class="w-9 h-9 rounded-full border-2 border-[#0b3dba] flex items-center justify-center bg-gray-100 text-gray-600">
+             <i class="fa-solid fa-user"></i>
+           </div>
+         @endif
+         <div class="leading-tight text-left">
+           <p class="text-sm font-semibold text-white lg:text-gray-800">{{ $headerUser->username ?? 'User' }}</p>
+           <p class="text-xs text-gray-400">{{ $headerUser->email ?? 'Master' }}</p>
+ </div>
+         <svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M19 9l-7 7-7-7"/></svg>
+       </button>
Removed / Before Commit
- 
- <a href="{{ route('users.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('users.*') ? $activeClass : $inactiveClass }}">
- <i class="fa-solid fa-user"></i>
-       Users List
- </a>
- 
- <a href="{{ route('profile') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('profile') ? $activeClass : $inactiveClass }}">
- <i class="fa-solid fa-address-book"></i>
- Profile
-     </a>
- 
- <a href="{{ route('orders.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('orders.*') ? $activeClass : $inactiveClass }}">
- <svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
- Orders
- </a>
- 
-     <a href="{{ route('return-refund.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('return-refund.*') ? $activeClass : $inactiveClass }}">
- <i class="fa-solid fa-arrow-rotate-left"></i>
Added / After Commit
+ 
+ <a href="{{ route('users.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('users.*') ? $activeClass : $inactiveClass }}">
+ <i class="fa-solid fa-user"></i>
+       Admin List
+ </a>
+ 
+     <a href="{{ route('customers.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('customers.*') ? $activeClass : $inactiveClass }}">
+       <i class="fa-solid fa-users"></i>
+       Customers List
+     </a>
+ <!-- 
+ <a href="{{ route('profile') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('profile') ? $activeClass : $inactiveClass }}">
+ <i class="fa-solid fa-address-book"></i>
+ Profile
+     </a> -->
+ 
+ <a href="{{ route('orders.index') }}" class="flex items-center gap-3 px-3 py-2.5 rounded-xl {{ request()->routeIs('orders.*') ? $activeClass : $inactiveClass }}">
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
Removed / Before Commit
- use App\Http\Controllers\Api\ServiceController;
- use App\Http\Controllers\Api\ContactController;
- use App\Http\Controllers\Api\AddressController;
- 
- Route::post('/register', [AuthController::class, 'apiRegister'])->name('api.register');
- Route::post('/login', [AuthController::class, 'apiLogin'])->name('api.login');
- Route::middleware('auth:sanctum')->group(function () {
- Route::post('/logout', [CustomerAuthController::class, 'logout']);
- 
- Route::get('/addresses', [AddressController::class, 'index']);
- Route::post('/addresses', [AddressController::class, 'store']);
- Route::put('/addresses/{id}', [AddressController::class, 'update']);
- Route::delete('/addresses/{id}', [AddressController::class, 'destroy']);
- Route::patch('/addresses/{id}/default', [AddressController::class, 'setDefault']);
- 
- Route::get('/cart', [CartController::class, 'index']);
- Route::post('/cart/add', [CartController::class, 'add']);
- Route::post('/cart/merge', [CartController::class, 'merge']);
Added / After Commit
+ use App\Http\Controllers\Api\ServiceController;
+ use App\Http\Controllers\Api\ContactController;
+ use App\Http\Controllers\Api\AddressController;
+ use App\Http\Controllers\Api\OrderController;
+ use App\Http\Controllers\Api\WishlistController;
+ use App\Http\Controllers\Api\CustomerProfileController;
+ 
+ Route::post('/register', [AuthController::class, 'apiRegister'])->name('api.register');
+ Route::post('/login', [AuthController::class, 'apiLogin'])->name('api.login');
+ Route::middleware('auth:sanctum')->group(function () {
+ Route::post('/logout', [CustomerAuthController::class, 'logout']);
+ 
+         Route::get('/profile', [CustomerProfileController::class, 'show']);
+         Route::put('/profile', [CustomerProfileController::class, 'update']);
+         Route::post('/profile/image', [CustomerProfileController::class, 'image']);
+ 
+ Route::get('/addresses', [AddressController::class, 'index']);
+ Route::post('/addresses', [AddressController::class, 'store']);
Removed / Before Commit
- <?php
- 
- use App\Http\Controllers\AuthController;
- use App\Http\Controllers\AdminProductCategoryController;
- use App\Http\Controllers\AdminProductController;
- use App\Http\Controllers\AdminFaqController;
- use App\Http\Controllers\AdminContactController;
- use App\Http\Controllers\AdminServiceController;
- use Illuminate\Support\Facades\Route;
- 
- Route::get('/', function () {
- return redirect()->route('login');
- });
- 
- Route::middleware('guest')->group(function (): void {
- Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
- Route::post('/login', [AuthController::class, 'login'])->name('login.store');
- Route::middleware('auth')->group(function (): void {
Added / After Commit
+ <?php
+ 
+ // use Illuminate\Support\Facades\Mail;
+ use App\Http\Controllers\AuthController;
+ use App\Http\Controllers\AdminProductCategoryController;
+ use App\Http\Controllers\AdminProductController;
+ use App\Http\Controllers\AdminFaqController;
+ use App\Http\Controllers\AdminContactController;
+ use App\Http\Controllers\AdminServiceController;
+ use App\Http\Controllers\AdminCustomerController;
+ use App\Http\Controllers\AdminOrderController;
+ use Illuminate\Support\Facades\Route;
+ 
+ Route::get('/', function () {
+ return redirect()->route('login');
+ });
+ 
+ // TEST MAIL — remove after testing