Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): nextUI with laravel #4432

Open
wants to merge 5 commits into
base: canary
Choose a base branch
from
Open

feat(docs): nextUI with laravel #4432

wants to merge 5 commits into from

Conversation

sudongyuer
Copy link
Member

@sudongyuer sudongyuer commented Dec 23, 2024

Closes #

📝 Description

image

⛳️ Current behavior (updates)

🚀 New behavior

💣 Is this a breaking change (Yes/No):

📝 Additional Information

Summary by CodeRabbit

  • New Features

    • Added a new documentation route for Laravel under the Frameworks section.
    • Introduced a comprehensive guide for integrating NextUI with Laravel, covering installation, dependencies, and setup instructions.
  • Bug Fixes

    • Minor formatting adjustments, including a newline at the end of the routes configuration file.

Copy link

linear bot commented Dec 23, 2024

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 9:19am
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 9:19am

Copy link

changeset-bot bot commented Dec 23, 2024

⚠️ No Changeset found

Latest commit: 4ae4d77

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request introduces a new route entry for "Laravel" in the routes.json configuration file and creates a corresponding Markdown documentation file for integrating NextUI with Laravel. The documentation outlines installation requirements, setup instructions, and compatibility notes, providing a structured guide for developers to effectively use NextUI within Laravel projects.

Changes

File Change Summary
apps/docs/config/routes.json Added new route entry for Laravel documentation with key, title, keywords, and path
apps/docs/content/docs/frameworks/laravel.mdx Created new documentation file detailing NextUI integration with Laravel

Possibly related PRs

  • feat: Adding nextui pro section on the landing page #4227: The addition of the new "NextUI Pro" section on the landing page may relate to the new Laravel documentation entry, as both involve enhancing the visibility and accessibility of features within the NextUI ecosystem.
  • feat(docs): nextUI pro callout #4391: The introduction of the NextUIProCallout component could be relevant as it promotes NextUI Pro, which aligns with the new Laravel documentation that integrates NextUI, thereby enhancing user engagement with both Laravel and NextUI features.

Suggested labels

📋 Scope : Docs


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
apps/docs/content/docs/frameworks/laravel.mdx (4)

1-4: Enhance the frontmatter description

Consider adding more details to the description to better reflect the content, such as mentioning the setup process and key integration points.

---
title: Laravel
-description: How to use NextUI with Laravel
+description: Learn how to integrate NextUI with Laravel, including installation, Tailwind CSS setup, and provider configuration
---

49-75: Add explanation for darkMode configuration

While the Tailwind configuration is correct, it would be helpful to explain the purpose of the darkMode: "class" setting and how it relates to NextUI's dark mode functionality.

🧰 Tools
🪛 LanguageTool

[style] ~51-~51: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can fol...

(REP_NEED_TO_VB)


[style] ~52-~52: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...eact) to install Tailwind CSS. Then you need to add the following code to your `tailwin...

(REP_NEED_TO_VB)


77-115: Add TypeScript configuration guidance

Since the example includes both .jsx and .tsx file extensions, consider adding a section about TypeScript configuration, especially for users who want to use TypeScript with NextUI in their Laravel project.

🧰 Tools
🪛 LanguageTool

[style] ~79-~79: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...der Setup After installing NextUI, you need to set up the NextUIProvider at the `roo...

(REP_NEED_TO_VB)


119-123: Move compatibility warning to the top

Consider moving this important compatibility warning to the top of the document, just after the requirements section. This would help users identify potential compatibility issues before starting the installation process.

apps/docs/config/routes.json (1)

85-90: Enhance keywords for better searchability

Consider adding more relevant keywords to help users find the Laravel integration documentation more easily.

{
  "key": "laravel",
  "title": "Laravel",
-  "keywords": "laravel, nextui",
+  "keywords": "laravel, nextui, php, inertia, tailwind, server-side rendering",
  "path": "/docs/frameworks/laravel.mdx"
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f388fc and 4ae4d77.

📒 Files selected for processing (2)
  • apps/docs/config/routes.json (2 hunks)
  • apps/docs/content/docs/frameworks/laravel.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/frameworks/laravel.mdx

[style] ~51-~51: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can fol...

(REP_NEED_TO_VB)


[style] ~52-~52: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...eact) to install Tailwind CSS. Then you need to add the following code to your `tailwin...

(REP_NEED_TO_VB)


[style] ~79-~79: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...der Setup After installing NextUI, you need to set up the NextUIProvider at the `roo...

(REP_NEED_TO_VB)

🔇 Additional comments (1)
apps/docs/content/docs/frameworks/laravel.mdx (1)

22-33: LGTM! Installation commands are clear and comprehensive

The installation section properly covers all major package managers and includes all necessary dependencies.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
apps/docs/content/docs/frameworks/laravel.mdx (4)

83-131: Consolidate duplicate provider setup examples

The provider setup code is duplicated:

  • First example (lines 83-95): Simple provider setup
  • Second example (lines 98-131): Same setup with Inertia.js integration

Consider consolidating these examples to avoid confusion, showing only the Inertia.js integration since that's the standard Laravel setup.


139-139: Fix grammar in installation instruction

Change "following command" to "following commands" since multiple package manager options are provided.

-In your Laravel project, run one of the following command to install NextUI:
+In your Laravel project, run one of the following commands to install NextUI:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~139-~139: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...ravel project, run one of the following command to install NextUI: <PackageManagers ...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


174-190: Clarify path configuration in Tailwind setup

The content path "./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}" assumes a specific project structure. Consider:

  • Adding a note about adjusting paths based on project structure
  • Mentioning common Laravel paths that should be included (e.g., resources/js/**/*.{js,ts,jsx,tsx})

192-230: Add dark mode setup instructions

The Tailwind configuration includes darkMode: "class", but there's no documentation on:

  • How to enable/disable dark mode
  • How to toggle dark mode
  • Best practices for dark mode implementation in Laravel
🧰 Tools
🪛 LanguageTool

[style] ~194-~194: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...der Setup After installing NextUI, you need to set up the NextUIProvider at the `roo...

(REP_NEED_TO_VB)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ae4d77 and 14abdc0.

📒 Files selected for processing (1)
  • apps/docs/content/docs/frameworks/laravel.mdx (1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/content/docs/frameworks/laravel.mdx

[style] ~57-~57: To strengthen your wording, consider replacing the phrasal verb “leave out”.
Context: ...Block bash nextui add --all ``` If you leave out the component name, the CLI will prompt...

(OMIT_EXCLUDE)


[uncategorized] ~139-~139: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...ravel project, run one of the following command to install NextUI: <PackageManagers ...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[style] ~166-~166: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can fol...

(REP_NEED_TO_VB)


[style] ~167-~167: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...eact) to install Tailwind CSS. Then you need to add the following code to your `tailwin...

(REP_NEED_TO_VB)


[style] ~194-~194: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...der Setup After installing NextUI, you need to set up the NextUIProvider at the `roo...

(REP_NEED_TO_VB)

🔇 Additional comments (1)
apps/docs/content/docs/frameworks/laravel.mdx (1)

234-238: LGTM! Clear compatibility warning

The warning about React version compatibility is well-placed and provides helpful guidance for users on older React versions.

Comment on lines +35 to +80
### Automatic Installation

You can add individual components using the CLI. For example, to add a button component:

```codeBlock bash
nextui add button
```

This command adds the Button component to your project and manages all related dependencies.

You can also add multiple components at once:

```codeBlock bash
nextui add button input
```

Or you can add the main library `@nextui-org/react` by running the following command:

```codeBlock bash
nextui add --all
```

If you leave out the component name, the CLI will prompt you to select the components you want to add.

```codeBlock bash
? Which components would you like to add? › - Space to select. Return to submit
Instructions:
↑/↓: Highlight option
←/→/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer

Filtered results for: Enter something to filter

◯ accordion
◯ autocomplete
◯ avatar
◯ badge
◯ breadcrumbs
◉ button
◯ card
◯ checkbox
◯ chip
◯ code
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add CLI installation instructions

The section uses nextui CLI commands but doesn't explain:

  • How to install the CLI tool
  • Where these commands should be run (project root?)
  • Whether this is a global or project-local tool

Consider adding a prerequisite step explaining how to install and configure the CLI tool.

🧰 Tools
🪛 LanguageTool

[style] ~57-~57: To strengthen your wording, consider replacing the phrasal verb “leave out”.
Context: ...Block bash nextui add --all ``` If you leave out the component name, the CLI will prompt...

(OMIT_EXCLUDE)

Comment on lines +26 to +33
<PackageManagers
commands={{
npm: 'npx create-laravel@latest --template https://github.com/nextui-org/laravel-template',
yarn: 'yarn create laravel --template https://github.com/nextui-org/laravel-template',
pnpm: 'pnpm create laravel --template https://github.com/nextui-org/laravel-template',
bun: 'bunx create-laravel@latest --template https://github.com/nextui-org/laravel-template',
}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Template repository URL is invalid

The commands reference a template repository at https://github.com/nextui-org/laravel-template which does not exist. This will cause the installation commands to fail.

  • apps/docs/content/docs/frameworks/laravel.mdx: Update the template URL to point to a valid repository or remove the template parameter if a default template should be used instead.
🔗 Analysis chain

Template repository URL appears to be missing

The commands reference a template repository at https://github.com/nextui-org/laravel-template which seems to be unavailable.

Let me verify the repository existence:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the template repository exists
gh repo view nextui-org/laravel-template 2>/dev/null || echo "Repository not found"

Length of output: 93

Comment on lines +8 to +14
Requirements:

- [Laravel 11](https://laravel.com/)
- [PHP v8.2](https://www.php.net/)
- [React 18](https://reactjs.org/) or later
- [Tailwind CSS 3.4](https://tailwindcss.com/docs/guides/vite#react) or later
- [Framer Motion 11.9](https://www.framer.com/motion/) or later
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Consider broadening version support in requirements

Based on the verification:

  • Laravel 10.x requires PHP ^8.1
  • Laravel 11.x requires PHP ^8.2
  • Laravel 10 is the current LTS version (supported until February 2025)

Recommend updating the requirements section to:

Requirements:

- [Laravel 10](https://laravel.com/) or later
- [PHP v8.1](https://www.php.net/) or later
- [React 18](https://reactjs.org/) or later
- [Tailwind CSS 3.4](https://tailwindcss.com/docs/guides/vite#react) or later
- [Framer Motion 11.9](https://www.framer.com/motion/) or later

This change would:

  • Include the current LTS version of Laravel
  • Support a broader range of PHP versions
  • Allow more users to adopt NextUI while maintaining compatibility
🔗 Analysis chain

Consider broadening version support in requirements

The current requirements might be too restrictive:

  • Laravel 11 was just released (March 2024), consider supporting Laravel 10 LTS
  • PHP 8.2 is not the minimum requirement for Laravel, consider supporting PHP 8.1

Let me verify the minimum supported versions:


Let me verify Laravel's version support further:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Laravel's composer.json for PHP version requirements
curl -s https://raw.githubusercontent.com/laravel/laravel/10.x/composer.json | jq '.require.php'

Length of output: 103


Script:

#!/bin/bash
# Check Laravel 11's composer.json for PHP version requirements
curl -s https://raw.githubusercontent.com/laravel/laravel/11.x/composer.json | jq '.require.php'

# Check if there are any other Laravel version references in the codebase
rg -i "laravel.*version|laravel.*requirement" --type mdx

Length of output: 190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant