Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spatie/laravel-blade-x
Use custom HTML components in your Blade views
https://github.com/spatie/laravel-blade-x
blade components laravel php rendering view
Last synced: about 1 month ago
JSON representation
Use custom HTML components in your Blade views
- Host: GitHub
- URL: https://github.com/spatie/laravel-blade-x
- Owner: spatie
- License: mit
- Archived: true
- Created: 2018-09-28T11:49:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-04T08:21:49.000Z (almost 5 years ago)
- Last Synced: 2024-05-17T07:42:48.425Z (7 months ago)
- Topics: blade, components, laravel, php, rendering, view
- Language: PHP
- Homepage: https://docs.spatie.be/laravel-blade-x
- Size: 891 KB
- Stars: 530
- Watchers: 11
- Forks: 41
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Notice
We have abandoned this package because Laravel 7 introduced native support for Blade-X style components.
Only use this package if you're on Laravel 6 or below.
When upgrading to Laravel 7 you should convert your Blade X components to native Laravel Blade components
# Supercharged Blade components
[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-blade-x.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-blade-x)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-blade-x/run-tests?label=tests)](https://github.com/spatie/laravel-blade-x/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-blade-x.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-blade-x)
[![StyleCI](https://github.styleci.io/repos/150733020/shield?branch=master)](https://github.styleci.io/repos/150733020)
[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-blade-x.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-blade-x)This package provides an easy way to render custom HTML components in your Blade views.
Here's an example. Instead of this
```blade
My view
@include('myAlert', ['type' => 'error', 'message' => $message])
```you can write this:
```blade
My view
```
You can place the content of that alert in a simple Blade view that needs to be [registered](https://docs.spatie.be/laravel-blade-x/v2/basic-usage/writing-your-first-component) before using the `my-alert` component.
```blade
{{-- resources/views/components/myAlert.blade.php --}}
{{ $message }}
```## Installation
You can install the package via Composer:
```bash
composer require spatie/laravel-blade-x
```The package will automatically register itself.
## Documentation
You'll find the documentation on [https://docs.spatie.be/laravel-blade-x/v2/introduction](https://docs.spatie.be/laravel-blade-x/v2/introduction).
Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the media library? Feel free to [create an issue on GitHub](https://github.com/spatie/laravel-blade-x/issues), we'll try to address it as soon as possible.
If you've found a bug regarding security please mail [[email protected]](mailto:[email protected]) instead of using the issue tracker.
## Upgrading major versions
Please see [UPGRADING](UPGRADING.md) for more information on how to upgrade from one major version to the other.
## Testing
``` bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Postcardware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.
We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards).
## Credits
- [Brent Roose](https://github.com/brendt)
- [Alex Vanderbist](https://github.com/alexvanderbist)
- [Ruben Van Assche](https://github.com/rubenvanassche)
- [Sebastian De Deyne](https://github.com/sebdedeyne)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)## Support us
Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource).
Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/spatie).
All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.