Skip to content
New issue

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

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

Already on GitHub? # to your account

[11.x] allow guessing of nested component #52669

Draft
wants to merge 4 commits into
base: 11.x
Choose a base branch
from

Commits on Sep 6, 2024

  1. allow guessing of nested component

    sometimes components will be part of a larger component grouping, and you may wish to group those components in a folder.
    
    as a simple example we'll use the classic "Card" component, which may be organized as such:
    
    - `App\View\Components\Card\Card`
    - `App\View\Components\Card\Header`
    - `App\View\Components\Card\Body`
    
    to utilize these in your Blade file you would:
    
    ```blade
    <x-card.card>
        <x-card.header>Title</x-card.header>
        <x-card.body>lorem ipsum</x-card.body>
    </x-card.card>
    ```
    
    while this is fine, it doesn't read as nice as it could. with this commit, we can now omit the trailing duplicated word, as long as the class name matches the folder name.
    
    ```blade
    <x-card>
        <x-card.header>Title</x-card.header>
        <x-card.body>lorem ipsum</x-card.body>
    </x-card>
    ```
    
    we do something similar with [Anonymous components](https://laravel.com/docs/11.x/blade#anonymous-index-components)
    browner12 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    994feae View commit details
    Browse the repository at this point in the history
  2. minor formatting

    browner12 committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    f80d303 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Configuration menu
    Copy the full SHA
    1eb1646 View commit details
    Browse the repository at this point in the history
  2. minor formatting

    browner12 committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    a662c24 View commit details
    Browse the repository at this point in the history