#### 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

Using Laravel Pest, Generate the following well-structured Laravel Pest Test Cases. Use inline comments where the logic might not be immediately clear.
PHPDoc should be comprehensive, detailing parameters, return types, and exceptions thrown. Adhere to Laravel and Filament PHP best practices, including naming conventions, code organization.

Unit Test (Use Cases and Edge Cases)

    Role Model:
        Use Cases:
            Creating a Role with valid name and unique slug.
            Updating a Role's name and slug.
            Soft deleting a Role and verifying deleted_at is set.
            Restoring a soft-deleted Role.
            Attaching and detaching Users to/from a Role.
        Edge Cases:
            Attempting to create a Role with a duplicate slug.
            Updating a Role with an invalid slug format.
            Deleting a Role that has associated Users.

    User Model:
        Use Cases:
            Creating a User with valid data, including name, unique email, and hashed password.
            Updating User details and changing roles.
            Soft deleting and restoring a User.
            Associating and dissociating Roles, Posts, and Comments.
        Edge Cases:
            Creating a User with an email that already exists.
            Updating a User's password with non-matching confirmation.
            Deleting a User who has Posts or Comments.

    Category Model:
        Use Cases:
            Creating a Category with a unique slug.
            Updating Category details.
            Soft deleting and restoring a Category.
            Associating Posts with a Category.
        Edge Cases:
            Creating a Category with a duplicate slug.
            Deleting a Category that has associated Posts.

    Tag Model:
        Use Cases:
            Creating a Tag with a unique slug.
            Updating Tag details.
            Soft deleting and restoring a Tag.
            Associating Posts with a Tag.
        Edge Cases:
            Creating a Tag with a duplicate slug.
            Deleting a Tag that is associated with multiple Posts.

    Post Model:
        Use Cases:
            Creating a Post with valid data, including title, unique slug, and status.
            Updating Post details and changing status.
            Soft deleting and restoring a Post.
            Associating Tags, Comments, and Likes with a Post.
        Edge Cases:
            Creating a Post with a duplicate slug.
            Publishing a Post without setting published_at.
            Deleting a Post that has Comments and Likes.

    Comment Model:
        Use Cases:
            Creating a Comment with valid data, including content and status.
            Updating Comment details and changing status.
            Soft deleting and restoring a Comment.
            Associating a parent Comment for nested comments.
        Edge Cases:
            Creating a Comment with a non-existent parent ID.
            Deleting a Comment that has child Comments.

    Analytics Model:
        Use Cases:
            Creating Analytics records with valid views_count, likes_count, and comments_count.
            Updating Analytics counts.
            Associating Analytics with a Post.
        Edge Cases:
            Creating Analytics for a non-existent Post.
            Setting negative values for counts.