This is the backend for the Car Inventory system, built with Laravel.
Ensure you have the following installed:
- PHP 8.2+
- Composer
- MySQL or another supported database
- (Optional) Herd for local development
Clone the repository and install dependencies:
composer installI did provide .env file so you don't have to copy it
Update .env with your database credentials:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=car_inventory_be
DB_USERNAME=root
DB_PASSWORD=Run migrations:
php artisan migrateHerd automatically sets up a local .test domain for the application:
http://car-inventory-be.test
Run the Laravel development server manually:
php artisan serve --host=0.0.0.0 --port=8000Update the frontend in {Your repository}/src/services/apiService.js API_BASE_URL accordingly:
const API_BASE_URL = "http://127.0.0.1:8000";CORS has been enabled globally to allow frontend applications to communicate with the API. If you are not using Herd, ensure that CORS is configured correctly in config/cors.php.
To explore API endpoints, use:
php artisan route:list- If you face CORS issues, update
config/cors.phpto specify allowed origins. - If the application doesn't start, ensure your database is running and
.envis correctly configured.