ahinkle/auto-resolvable-blade-components

A Laravel package to automatically resolve your Blade Component views based on the component class names.

3.0.1 2024-03-12 17:07 UTC

This package is auto-updated.

Last update: 2024-11-12 18:32:35 UTC


README

Build Latest Version Total Downloads

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.