It's like React for PHP. Powered by Laravel, Livewire, Tailwind, & Alpine.

Overview

Tailwire

It's like React for PHP. Powered by Laravel, Livewire, Tailwind, & Alpine.

Features:

  • Use a custom view component class namespace
  • Declare routes directly inside full page Livewire components
  • Install Tailwind & Alpine with a single command
  • Code using a component-based approach rather than MVC
  • Write view code directly inside components (inline)
  • Declare migrations & factory definitions inside models

Requirements:

  • Laravel 8
  • NPM

Installation

This package was designed to work with new Laravel projects.

Install Laravel via Composer/Docker/whatever you prefer:

laravel new my-app

Require Tailwire via Composer:

composer require heyjoe1984/tailwire

Install Tailwire:

php artisan tw:install

This will install and configure Tailwind & Alpine, create an app layout component, and a new User model.

When you're ready to start building your app, run npm run watch to activate tailwind JIT mode.

Commands

Create a Livewire component with a route method and inline view included:

php artisan tw:livewire my-component-name

Create a view component in your custom namespace with an inline view included:

php artisan tw:view my-component-name

Create a model with migration & factory definition methods included:

php artisan tw:model my-model-name

Run model-based migrations:

php artisan tw:migrate {--fresh} {--seed}

Using Custom View Component Namespaces

Publish the package config:

php artisan vendor:publish

Update the view_namespace to whatever you prefer:

'view_namespace' => 'App\\Http\\View',

Now any component created inside this namespace can be access via <x-my-component-name> tags.

Declaring Full Page Livewire Routes

Create a route method inside your Livewire component:

use Illuminate\Support\Facades\Route;
use Livewire\Component;

class MyComponentName extends Component
{
    public function route()
    {
        return Route::get('/my-component-name')
            ->name('my-component-name');
    }

    public function render()
    {
        return <<<'HTML'
            <div>
                <!-- Stop trying to control. -->
            </div>
        HTML;
    }
}

The route method should return the Laravel Route facade.

Declaring Migrations & Factory Definitions Inside Models

Create migration and definition methods inside your model:

use Faker\Generator;
use Heyjoe1984\Tailwire\Traits\HasNewFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;

class MyModelName extends Model
{
    use HasNewFactory;

    public function migration(Blueprint $table)
    {
        $table->id();
        $table->string('name');
        $table->timestamps();
    }

    public function definition(Generator $faker)
    {
        return [
            'name' => $faker->name(),
        ];
    }
}

Run the model-based migrations command:

php artisan tw:migrate

Use -f for fresh migration, and -s to seed using model-based factory definitions afterwards.

This command will also run your traditional migration files first for those edge-cases.

You might also like...
This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

This is a Laravel package for msegat. Its goal is to remove the complexity

laravel-msegat package This is a Laravel package for msegat. Its goal is to remove the complexity Laravel Msegat Package This is a package for msegat.

Easily add all the 58 Algerian Wilayas and its Dairas to your cool Laravel project (Migrations, Seeders and Models).
Easily add all the 58 Algerian Wilayas and its Dairas to your cool Laravel project (Migrations, Seeders and Models).

Laravel-Algereography Laravel-Algereography allows you to add Migrations, Seeders and Models of Algerian Wilayas and Dairas to your existing or new co

This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.
Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.

Laravel Befriended Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked

Laravel Backend API for the tutorial (Granular permissions with Laravel APIs & React frontend)

Laravel Granular Permissions Backend Getting Started Clone the repository. Install the dependencies composer install Update .env database credentials

Laravel Real-time chat app demo with React, Laravel Echo, Breeze, Socket.io, Redis, Inertia.js, TailwindCSS stack.

Laravel Real-time Chat App You can build yours from scratch with the following Medium article https://medium.com/@sinan.bekar/build-a-real-time-chat-a

This is a simple url bot validator made with laravel and react

🚀 This is a simple URL validator. Used Technologies React - Javascript framework Laravel - PHP framework Mysql - Relational database Installation Ins

Multi layout react laravel

multi-layout-react-laravel multi layout react-laravel is a repository for creating 1 integrated system, this repository uses react(laravel ui) version

Owner
null
Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.

Nebula Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS. Nebula m

Nebula 228 Nov 11, 2022
Free and open-source Laravel admin dashboard interface built with Livewire & Alpine.js based on Bootstrap 5

Volt Dashboard Laravel Free Frontend Web App for Laravel with Livewire & Alpine.js Never start a development project from scratch again. We've partner

Themesberg 200 Jan 4, 2023
Sweetalert and Toaster notifications for Laravel livewire with support for tailwind and bootstrap.

Larabell Integrate livewire with sweetalert. Installation How to use Sweetalert Toast Available configuration Installation composer require simtabi/la

Simtabi 3 Jul 27, 2022
Aplicación Laravel-Livewire-Tailwind. La aplicación se conecta a APIRest y muestra resultados, búsquedas, historial, Responsive Design

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Juan Gómez 0 Feb 10, 2022
Livewire UI components with tailwind base style

WireUI ?? Documentation Wire UI is a library of components and resources to empower your Laravel and Livewire application development. Starting a new

WireUi 811 Jan 2, 2023
cybercog 996 Dec 28, 2022
Laravel-comments-livewire - Livewire components for the laravel-comments package

Associate comments and reactions with Eloquent models This package contains Livewire components to be used with the spatie/laravel-comments package. S

Spatie 15 Jan 18, 2022
A simple blog app where a user can signup , login, like a post , delete a post , edit a post. The app is built using laravel , tailwind css and postgres

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Nahom_zd 1 Mar 6, 2022
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Livewire UI 792 Jan 3, 2023
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Wire Elements 790 Dec 27, 2022