Skip to content

I3rixon/cartEst

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

Cart Test

This is a Laravel-based e-commerce application with the following features:

Features

User Management

  • User List: Displays a list of all users on the home page.
  • Login as User: Allows to log in as any user by clicking a button next to the user's name.

Product Management

  • Product List: Displays a paginated list of products.
  • Pagination: Products are displayed with pagination to improve performance and user experience.

Cart Management

  • View Cart: Displays the user's cart items.
  • Add to Cart: Allows users to add products to their cart.
  • Update Cart: Allows users to update the quantity of products in their cart.
  • Remove from Cart: Allows users to remove products from their cart.

Utility Routes

  • Timezone Test: Returns the current date and time.

Screenshots

Home Page

Home Page

Products Page

Products Page

Cart Page

Cart Page

Login as User

Login as User

Installation

  1. Clone the repository:

    git clone https://github.com/I3rixon/cartEst.git
    cd cartEst
  2. Install dependencies:

    composer install
    npm install
  3. Copy the .env.example file to .env and configure your environment variables:

    cp .env.example .env
  4. Generate an application key:

    php artisan key:generate
  5. Run migrations:

    php artisan migrate
  6. Seed the database (optional):

    php artisan db:seed
  7. Start the development server:

    php artisan serve

Usage

  • Visit the home page to see the list of users.
  • Navigate to the products page to see the list of products with pagination.
  • Add, update, or remove products from the cart.
  • Use the "Login as User" feature to log in as any user.

License

This project is licensed under the MIT License.

Changes

[Unreleased] - 2023-12-20 22:15:28

  • Updated web.php:

    • Added auth middleware to routes for adding, updating, and removing items from the cart.
    • Ensured only authenticated users can access these routes.
  • Updated CartControllerTest:

    • Ensured the user and product exist before running tests.
    • Used withoutMiddleware to bypass CSRF token validation for testing purposes.
    • Added assertions to verify the correct response and database state.

    Test passed for CartController

    Test Passed

About

This is a Laravel-based e-commerce application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published