This repository contains a RESTful API project for the Ujian Tengah Semester (UTS) assignment.
- PHP (recommended version 7.4 or higher)
- Composer
- MySQL or any other database supported by Laravel
- Laravel Valet, Laravel Homestead, or any other local development environment (optional)
-
Navigate to the Project Directory:
cd utspbfhusni
-
Install Dependencies:
composer install
-
Environment Configuration:
-
Create a copy of the
.env.example
file and name it.env
:cp .env.example .env
-
Configure your database connection in the
.env
file:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_username DB_PASSWORD=your_database_password
-
-
Generate Application Key:
php artisan key:generate
-
Database Migration:
php artisan migrate
-
Serve the Application:
php artisan serve
By default, the application will be served at http://localhost:8000.
- Authentication: Users can register, log in, log out, and refresh their authentication tokens.
- User Management: CRUD operations for users, including viewing, creating, updating, and deleting users.
- Product Management: CRUD operations for products, including viewing, creating, updating, and deleting products.
- Category Management: CRUD operations for product categories, including viewing, creating, updating, and deleting categories.
- Optional: If you want to test the API endpoints, you can import the provided Postman collection (
utshusni.postman_collection.json
) into your Postman application.
Now, your Laravel project should be up and running locally. You can access it through your web browser or test the API endpoints using a tool like Postman.
If you encounter any issues during the installation process, refer to the Laravel documentation or feel free to ask for further assistance!