Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #370
    dan
    Participant

    @include and components are two different ways to recycle view code in Laravel Blade.

    Using @include:

    @include(‘mycomponent’)

    Using component:

    <x-mycomponent />

    #371

    Components is more powerful way of recycling code specially in manipulating data attributes:

    Here what it says in the Laravel documentation:

    “While you’re free to use the @include directive, Blade components provide similar functionality and offer several benefits over the @include directive such as data and attribute binding.”

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.