#### Role Management Module
- **id**: bigint, unsigned, auto-increment, primary key
- **name**: string
- **slug**: string, unique
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
        - Has many Users (many-to-many)

#### User Management Module
        - **Tables:**
     - `users`
     - `role_user` (pivot table for many-to-many relationship between roles and users)
         
#### User
- **id**: bigint, unsigned, auto-increment, primary key
- **name**: string
- **email**: string, unique
- **password**: string
- **avatar**: string, nullable
- **bio**: text, nullable
- **role_id**: bigint, unsigned, foreign key referencing `roles.id`
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
    - Has many Roles (many-to-many)
    - Has many Posts
    - Has many Comments
        
#### RoleUser (Pivot Table)
- **role_id**: bigint, unsigned, foreign key referencing `roles.id`
- **user_id**: bigint, unsigned, foreign key referencing `users.id`
- **primary key**: (`role_id`, `user_id`)



#### Category Management Module
- **id**: bigint, unsigned, auto-increment, primary key
- **name**: string
- **slug**: string, unique
- **description**: text, nullable
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
    - Has many Posts

#### Tag Management Module
- **id**: bigint, unsigned, auto-increment, primary key
- **name**: string
- **slug**: string, unique
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
    - Has many Posts (many-to-many)

### **Post Management Module**
   - **Tables:**
     - `posts`
     - `post_tag` (pivot table for many-to-many relationship between posts and tags)

#### Post
- **id**: bigint, unsigned, auto-increment, primary key
- **user_id**: bigint, unsigned, foreign key referencing `users.id`
- **category_id**: bigint, unsigned, foreign key referencing `categories.id`
- **title**: string
- **slug**: string, unique
- **content**: text
- **excerpt**: text, nullable
- **featured_image**: string, nullable
- **status**: enum ('draft', 'published', 'archived')
- **published_at**: timestamp, nullable
- **seo_title**: string, nullable
- **seo_description**: text, nullable
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
    - Belongs to User
    - Belongs to Category
    - Has many Comments
    - Has many Likes
    - Has many Tags (many-to-many)

#### PostTag (Pivot Table)
- **post_id**: bigint, unsigned, foreign key referencing `posts.id`
- **tag_id**: bigint, unsigned, foreign key referencing `tags.id`
- **primary key**: (`post_id`, `tag_id`)

#### Comment Management Module
- **id**: bigint, unsigned, auto-increment, primary key
- **user_id**: bigint, unsigned, foreign key referencing `users.id`
- **post_id**: bigint, unsigned, foreign key referencing `posts.id`
- **parent_id**: bigint, unsigned, nullable, foreign key referencing `comments.id`
- **content**: text
- **status**: enum('pending', 'approved', 'rejected')
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **deleted_at**: timestamp, nullable
- **Relationships**
    - Belongs to User
    - Belongs to Post
    - Belongs to Comment (self-referencing for nested comments)
    - Has many Comments (self-referencing for nested comments)

#### Analytics Management Module
- **id**: bigint, unsigned, auto-increment, primary key
- **post_id**: bigint, unsigned, foreign key referencing `posts.id`
- **views_count**: integer, default: 0
- **likes_count**: integer, default: 0
- **comments_count**: integer, default: 0
- **created_at**: timestamp, nullable
- **updated_at**: timestamp, nullable
- **Relationships**
    - Belongs to Post

For each of the database table schema above, Using the Chain of Thought Prompting, Meticulously generate a well-structured Laravel migration, and model class that Adhere to Laravel best practices, including naming conventions, code organization, and SOLID principles and Ensure that the code is clean, maintainable, and follows the DRY (Don't Repeat Yourself) principle and also PHPDoc should be comprehensive, detailing parameters, return types, and exceptions thrown. The aim of the generated code is to adhere to Laravel  best practices, coding standard, and deliver the highest standards of software development, delivering a well-documented, robust, and efficient module that fulfills the application's business requirements and provides an exceptional user experience: