ahinkle / auto-resolvable-blade-components
A Laravel package to automatically resolve your Blade Component views based on the component class names.
Installs: 9 206
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1|^8.2
- illuminate/support: ^10.0|^11.0
- illuminate/view: ^10.0|^11.0
Requires (Dev)
- illuminate/container: ^10.0|^11.0
- illuminate/contracts: ^10.0|^11.0
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^9.5|^10.0
This package is auto-updated.
Last update: 2024-10-12 18:18:39 UTC
README
Automatically resolve your Blade Component views based on the component class names to allow for cleaner components.
This package was built on common architecture patterns between Laravel Components and Livewire Components. Livewire automatically resolves the Blade Views whereas Laravel Components do not and require the render()
method. This simple but useful package solves that.
<?php namespace App\View\Components; use Ahinkle\AutoResolvableComponents\AutoResolvableComponent; class Alert extends AutoResolvableComponent { // }
Will automatically render the view: components.alert
.
Installation
You can install the package via composer:
composer require ahinkle/auto-resolvable-blade-components
Usage
Simply extend the AutoResolvableComponent
class (vs. component
) on your Blade Component:
use Ahinkle\AutoResolvableComponents\AutoResolvableComponent; class Alert extends AutoResolvableComponent { // ....
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ahinkle10@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.