PHPackages                             chstudio/laravel-transclude - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. chstudio/laravel-transclude

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

chstudio/laravel-transclude
===========================

Allow to use Angular transclude features within Blade templates.

v1.1.0(8y ago)21.3k1Apache-2.0PHPPHP &gt;=5.6.4

Since Aug 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/CHStudio/laravel-transclude)[ Packagist](https://packagist.org/packages/chstudio/laravel-transclude)[ RSS](/packages/chstudio-laravel-transclude/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

Laravel Transclude
==================

[](#laravel-transclude)

[![Build Status](https://camo.githubusercontent.com/6845b07aef04d5beadf0b3d263b8fcfaffde97da9efed047c678d521d184a9c6/68747470733a2f2f7472617669732d63692e6f72672f434853747564696f2f6c61726176656c2d7472616e73636c7564652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/CHStudio/laravel-transclude)[![Coverage Status](https://camo.githubusercontent.com/19239cd2a6b410e1a37fda475dfb01f0a44e5d15f0eada00b568f4c9ceb8d170/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f434853747564696f2f6c61726176656c2d7472616e73636c7564652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/CHStudio/laravel-transclude?branch=master)

This package allow to use [transclusion](https://en.wikipedia.org/wiki/Transclusion) from Blade template engines. It's very useful when you want to handle views as component. It's inspired by the Angular transclude logic.

Installing
----------

[](#installing)

[![Latest Stable Version](https://camo.githubusercontent.com/c5826242f80c0e4cc0994d68d3dc1c26ddcdbc73a6ea21131d7c3f452adfdd76/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636873747564696f2f6c61726176656c2d7472616e73636c7564652e737667)](https://packagist.org/packages/chstudio/laravel-transclude)[![Total Downloads](https://camo.githubusercontent.com/17fbfbd26edcc317e4205e23fdc57999a49b4ce2e1bf95b52281da25a79259c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f636873747564696f2f6c61726176656c2d7472616e73636c7564652e737667)](https://packagist.org/packages/chstudio/laravel-transclude)

This project can be installed using Composer. Add the following to your `composer.json`:

```
{
    "require": {
        "chstudio/laravel-transclude": "~2.0"
    }
}
```

or run this command:

```
composer require chstudio/laravel-transclude
```

After updating composer, add the `ServiceProvider` to the providers array in `config/app.php`.

### Laravel 5.5+

[](#laravel-55)

This library is compatible with the package auto-discovery feature so you have nothing to do... If you prefer adding yourself your providers, please follow the [official documentation guidelines](https://laravel.com/docs/5.5/packages#package-discovery).

### Laravel &lt;5.5:

[](#laravel-55-1)

Add this in the `providers` section of the `config/app.php` file :

```
CHStudio\LaravelTransclude\TranscludeServiceProvider::class,
```

Then you can use the new blade directives in your views !

Usage
-----

[](#usage)

This package register three new Blade directives :

- `@transclude` / `@endtransclude` to write inside a transcluded block,
- `@transcluded` to declare a space where the transclusion will be written.

For example, take the [Bootstrap](http://getbootstrap.com/) form elements, they are all using the same global structure. Then in that structure there are different html blocks depending on the form element.

### Create template files

[](#create-template-files)

#### `input-group.blade.php`

[](#input-groupbladephp)

```

    {{$label}}

    @transcluded

```

#### `radio.blade.php`

[](#radiobladephp)

```
@transclude('input-group')
    @foreach($options as $option)

            {{$option['label']}}

    @endforeach
@endtransclude
```

### Use the new blocks

[](#use-the-new-blocks)

Then after writing this 3 files, you can add an element using the `@include` directive :

```

    @include('radio', [
        'options' => [
            ['value' => '1', 'label' => 'Option 1']
        ],
        'selected' => '1',
        'label' => 'My radio button'
        'name' => 'my-radio'
    ])

```

This code will generate a full radio element with a combination of input-group and radio templates :

```

        My radio button

                Option 1

```

Contributing
------------

[](#contributing)

We welcome everyone to contribute to this project. Below are some of the things that you can do to contribute.

- Read [our contributing guide](CONTRIBUTING.md).
- [Fork us](https://github.com/chstudio/laravel-transclude/fork) and [request a pull](https://github.com/chstudio/laravel-transclude/pulls) to the [master](https://github.com/chstudio/laravel-transclude/tree/master) branch.
- Submit [bug reports or feature requests](https://github.com/chstudio/laravel-transclude/issues) to GitHub.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

3

Last Release

3178d ago

Major Versions

v0.0.1 → v1.0.02017-08-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ab317af777924eeefe097aa3e0a423f069eaac20280e3241631e1a950e17f47?d=identicon)[shulard](/maintainers/shulard)

---

Top Contributors

[![shulard](https://avatars.githubusercontent.com/u/482993?v=4)](https://github.com/shulard "shulard (19 commits)")

---

Tags

laravelphptranscludelaravelpackagetranscludetransclusion

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/chstudio-laravel-transclude/health.svg)

```
[![Health](https://phpackages.com/badges/chstudio-laravel-transclude/health.svg)](https://phpackages.com/packages/chstudio-laravel-transclude)
```

###  Alternatives

[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
