# Inblr Laravel Backend

This folder contains the Laravel backend scaffold for:

- businesses
- categories with icons
- tags with single create and bulk import
- main and sub locations
- reviews
- business images and logo uploads
- homepage ads
- homepage sections and content blocks
- users and roles
- favorites

## Suggested setup when PHP is available

```bash
cd laravel-backend
composer install
copy .env.example .env
php artisan key:generate
php artisan migrate
php artisan db:seed
php artisan storage:link
```

## Main API groups

- `/api/admin/categories`
- `/api/admin/tags`
- `/api/admin/tags/import`
- `/api/admin/locations`
- `/api/admin/businesses`
- `/api/admin/users`
- `/api/admin/reviews`
- `/api/admin/ads`
- `/api/admin/homepage-sections`
- `/api/admin/media`

## Backend web panel

After deployment, the web admin panel is available at:

- `/backend/login`

Default seeded admin credentials:

- `admin@inblr.com`
- `Password123`

## Feature notes

- Categories support `icon_path` and can use the shared media upload endpoint.
- Tags support normal single create and bulk import through `/api/admin/tags/import`.
- Locations support hierarchical parent/child relationships for main and sub locations.
- Businesses support category assignment, tag assignment, logo upload path, gallery images, map links, working hours, and city/area location mapping.
- Reviews include moderation status handling. Public review APIs now return approved reviews only.
- Homepage ads support placements, dates, sort order, image path, and activation state.
- Homepage sections provide editable backend-controlled homepage content blocks.
- Seed data now includes:
  - default admin user: `admin@inblr.com` / `Password123`
  - homepage section keys: `hero_banner`, `home_highlights`, `top_areas`, `city_places`

## Shared hosting note

The frontend defaults to same-origin `/api` when hosted on a web server. If your API is on a different domain or subdomain, set `window.INBLR_API_BASE` before loading `api.js`.

## Important note

This machine currently does not have `php` or `composer`, so this backend was created and patched manually and was not executed here.
