26b/backstate

Package with blade and livewire components
1,703 1
Install
composer require 26b/backstate
PHP:^8.1 || ^7.4
License:MIT
Last Updated:Jan 25, 2024
Links: GitHub  ·  Packagist
Maintainer: xipasduarte

BackState

Laravel package with blade and livewire components defining base logic/state and, also, layouts to use in your laravel project.

How to use

Let's imagine this package has defined a livewire component (is the same thing for blade) called Example:

<?php

namespace TwentySixB\BackState\Components\Livewire;

use Livewire\Component;

class Example extends Component
{
    /**
     * Hiding component logic since it does not make a difference for the illustration.
     */

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|string
     */
    public function render()
    {
        return view('backstate::livewire.example');
    }
}

and we want to use it in our project in the view called my-view:

<!-- resources/views/my-view.blade.php -->

@extends('layouts.app')

@section('content')
    {{-- Calling backstate component `example` --}}
    <backstate:example/>
@endsection

If, for some reason, you want to override the component view, just create the folder resources/views/vendor/backstate/livewire/ defining here the components views we want to modify, like:

<!-- resources/views/vendor/backstate/livewire/example.blade.php -->

<div>
    {{ __('New component view') }}
</div>

Related Packages

livewire/flux

The official UI component library for Livewire.

11,762,163 978
infyomlabs/adminlte-templates

AdminLTE templates for InfyOm Laravel Generator

1,647,905 266
garygreen/pretty-routes

Pretty routes for Laravel 5+

1,391,611 650
infyomlabs/swagger-generator

Swagger Generator for InfyOm Laravel Generator

1,123,584 114
snowfire/beautymail

Send beautiful html emails with Laravel

776,085 1,313