# Kdot Web Tech - Laravel CMS Setup Guide

## Overview

This Laravel application is a full-featured Content Management System (CMS) for the Kdot Web Tech website. It allows you to manage all website content from a dedicated admin dashboard, eliminating the need to manually edit HTML files.

## Current Setup

- **Database**: SQLite (configured by default)
- **Framework**: Laravel 12
- **PHP Version**: 8.0 or higher
- **Status**: Fully configured and ready to use

## Quick Start

### 1. Start the Laravel Development Server

```bash
cd c:\Users\moonn\Desktop\my agency\kdot-web-tech
php artisan serve
```

The application will be available at `http://127.0.0.1:8000`

### 2. Access the Website

- **Homepage**: `http://127.0.0.1:8000/`
- **About**: `http://127.0.0.1:8000/about`
- **Services**: `http://127.0.0.1:8000/services`
- **Blog**: `http://127.0.0.1:8000/blog`

### 3. Access the Admin Dashboard

- **Admin URL**: `http://127.0.0.1:8000/admin/services`

From the admin dashboard, you can:

- **Manage Services**: Add, edit, and delete services displayed on the website
- **Manage Testimonials**: Add and update client testimonials and reviews
- **Manage Blog Posts**: Create and publish blog articles
- **Manage Pages**: Create additional pages and edit existing content

## Database

### Current Configuration

The application uses **SQLite** for the database, which is located at:

```
database/database.sqlite
```

### Switching to MySQL (Optional)

If you want to switch to MySQL:

1. Create a MySQL database:
   ```sql
   CREATE DATABASE kdot_web_tech;
   ```

2. Update `.env` file:
   ```
   DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=kdot_web_tech
   DB_USERNAME=root
   DB_PASSWORD=
   ```

3. Run migrations:
   ```bash
   php artisan migrate --seed
   ```

## Admin Features

### Services Management

**Location**: `/admin/services`

Manage the four services displayed on your homepage:
- Web Development
- App Development
- UI/UX Web Design
- Tech Development

Each service has:
- Title
- Slug (URL-friendly name)
- Description
- Icon reference
- Display order
- Active/Inactive status

### Testimonials Management

**Location**: `/admin/testimonials`

Add client testimonials that appear in the "What our clients review" section:
- Client name
- Client title/position
- Full testimonial text
- Client image
- Display order
- Active/Inactive status

### Blog Management

**Location**: `/admin/blog`

Create and manage blog posts:
- Title and slug
- Featured image URL
- Category
- Excerpt and full content
- Publish date and time
- Draft or published status

### Pages Management

**Location**: `/admin/pages`

Create custom pages for your website:
- Title and slug
- Banner title and description
- Page description
- Page content
- Meta tags for SEO
- Publish status

## File Structure

```
kdot-web-tech/
├── app/
│   ├── Http/
│   │   └── Controllers/
│   │       ├── HomeController.php       # Frontend page displays
│   │       └── AdminController.php      # CMS management
│   └── Models/
│       ├── Page.php
│       ├── Service.php
│       ├── Testimonial.php
│       └── BlogPost.php
├── database/
│   ├── database.sqlite                  # SQLite database
│   ├── migrations/                      # Database schemas
│   └── seeders/
│       └── DemoContentSeeder.php       # Initial demo data
├── resources/
│   └── views/
│       ├── layouts/
│       │   ├── app.blade.php           # Frontend layout
│       │   └── admin.blade.php         # Admin layout
│       ├── home.blade.php              # Homepage
│       ├── about.blade.php
│       ├── services.blade.php
│       ├── blog/
│       │   ├── index.blade.php
│       │   └── show.blade.php
│       └── admin/
│           ├── services/
│           ├── testimonials/
│           ├── blog/
│           └── pages/
├── routes/
│   └── web.php                         # All routes defined here
└── .env                                # Configuration file
```

## Database Tables

### Services Table
Stores all service information
- id, title, slug, description, icon, order, is_active, timestamps

### Testimonials Table
Stores client testimonials
- id, description, client_name, client_title, client_image, order, is_active, timestamps

### Blog Posts Table
Stores blog articles
- id, title, slug, excerpt, content, featured_image, category, published_at, is_published, timestamps

### Pages Table
Stores custom pages
- id, title, slug, description, content, banner_title, banner_description, meta_title, meta_description, is_published, timestamps

## Initial Demo Content

The database has been seeded with sample content:

### Services (4 total)
1. Web Development
2. App Development
3. UI/UX Web Design
4. Tech Development

### Testimonials (3 total)
1. Abdur Rashid - Founder & CEO
2. Nayeem - Developer
3. Marry Jaen - Team Manager

### Blog Posts (3 total)
1. The Future of Web Development
2. Custom Software Solutions for Enterprise Growth
3. Best Practices in Modern App Development

## Using the Frontend

The homepage displays all content from the database:

- **Services Section**: Pulls from Services table, displays in order
- **Testimonials Section**: Pulls from Testimonials table, displays active ones
- **Blog Section**: Pulls 3 latest published BlogPosts
- **Individual Blog Pages**: Each post has its own page accessible via `/blog/{slug}`

## Editing Website Content

### To Update Service Descriptions:

1. Go to `/admin/services`
2. Click "Edit" on the service you want to modify
3. Update the description or other fields
4. Click "Update Service"
5. Changes appear immediately on the website

### To Add a New Testimonial:

1. Go to `/admin/testimonials`
2. Click "+ Add Testimonial"
3. Enter client details and their testimonial text
4. Click "Create Testimonial"
5. New testimonial appears on homepage

### To Publish a Blog Post:

1. Go to `/admin/blog`
2. Click "+ Add Post"
3. Enter title, content, category, etc.
4. Check "Publish Now" to make it live
5. Click "Create Post"
6. Post appears on blog page and homepage

## Deployment

When ready to deploy to production:

1. Set `APP_ENV=production` in `.env`
2. Set `APP_DEBUG=false` in `.env`
3. Generate app key: `php artisan key:generate`
4. Run migrations on production database
5. Set proper permissions on `storage/` and `bootstrap/cache/` directories
6. Configure your web server (Nginx/Apache) to serve the `public/` directory

## Troubleshooting

### Database file not found
Create the database file:
```bash
touch database/database.sqlite
php artisan migrate --seed
```

### Migrations failed
Clear and re-run:
```bash
php artisan migrate:refresh --seed
```

### Admin pages showing 404
Make sure routes are cached:
```bash
php artisan route:clear
php artisan route:cache
```

## Support

For Laravel documentation: https://laravel.com/docs
For help with your specific setup, review the files in:
- `routes/web.php` - All application routes
- `app/Http/Controllers/AdminController.php` - Admin logic
- `app/Models/` - Database models

---

**Created**: July 27, 2026
**Version**: 1.0.0
**Status**: Production Ready
