26b/backstate

Package with blade and livewire components

Maintainers

👁 xipasduarte

Package info

github.com/26B/backstate

Language:Blade

pkg:composer/26b/backstate

Statistics

Installs: 1 703

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 5

dev-main 2024-01-25 13:27 UTC

Requires

  • php: ^8.1 || ^7.4

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 34dbb9cf57a738a365f064824d6d975dbb8c133d

  • 26B <hello.woop@26b.io>

README

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>