Download the PHP package redbastie/tailwire without Composer

On this page you can find all versions of the php package redbastie/tailwire. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tailwire

No Longer Maintained

Please check out my new package here: https://github.com/bastinald/malzahar

It's a much better implementation of what this package was trying to do.

Tailwire

Build reactive web apps without having to write HTML, CSS, or JavaScript! Powered by Laravel Livewire and Tailwind.

Imagine a world where you no longer have to constantly context switch between HTML, CSS, and Javascript. Where all of your code can reside in self-contained PHP component classes. Even your database migration logic can stay inside of your models. It's kind of like SwiftUI for PHP!

Requirements

Features

Packages Used

Docs

Links

Installation

Create a new Laravel 8 project:

Configure your .env app, database, and mail values:

Require Tailwire via composer:

Install Tailwire:

Commands

Install Tailwire

Installs the layout & index components, User model & factory, config files, icons, PWA manifest, Tailwind CSS & config, JavaScript assets, webpack, and runs the necessary NPM commands.

Generate auth scaffolding

Generates auth components including login, logout, register, password reset, and home.

Generate a component

Generates a Tailwire component. Use --full to generate a full page component, --modal for a modal, --list --model=ModelClass for a list, or omit all options for a basic component.

Examples

Generate CRUD components

Generates CRUD components for the specified model class. If the model class does not exist, it will be created along with a factory automatically.

If you specify User as the class, full user CRUD will be generated.

Examples

Generate a Tailwire model

Generates a Tailwire model and factory which comes with the automatic migration method and factory definition included. As with other commands, you can specify a subdirectory for the class.

Examples

Run automatic migrations

Runs automatic migrations for all of your Tailwire models which have a migration method specified. This uses Doctrine to automatically diff your database and apply the necessary changes.

Optionally use --fresh to wipe the database, and --seed to run your seeders afterwards. If you wish to run this in production, use the --force.

Note that if you still want to use traditional Laravel migration files, they will run before automatic migration methods.

Usage

Routing full page components

Specify public $route* properties in your Tailwire component in order to enable automatic routing. A minimum of $routeUri is required in order to enable automatic routing for the component. Available properties include $routeUri, $routeName, $routeMiddleware (string or array), $routeDomain, $routeWhere (array).

If using route parameters, be sure to include them in a mount method:

Extending layout components

Specify a $viewExtends property which uses dot notation to point to the component that this component will extend. In this example, the $viewExtends property is pointing to the Layouts/App component.

In the Layouts/App component, the $v->yield() method is used in order to render the child component inside:

Building HTML elements

Tailwire uses an expressive syntax in order to build HTML elements. As you can see, the $v variable is used to construct each element in the view. The first method of a $v chain consists of the HTML element name. A list of available HTML element names can be found here: HTML Element Reference

After the first method, each additional chained method represents an attribute of the element. For example, creating an image:

This would translate to an image with an src of the asset URL, using the Tailwind classes w-5 h-5 for styling. A list of available HTML element attributes can be found here: HTML Attribute Reference

In this example, you can see that the img method does not accept any parameters, because it does not use a closure tag. Elements that use a closure tag, such as div, do accept ...$content parameters, which you can use in order to build content inside:

Styling elements via Tailwind

Specify the Tailwind classes for an element within the chained class() method.

Now you might be thinking, "but there isn't autocomplete!" Good news; install the VSCode extension "Tailwind CSS Intellisense", then add the following to your settings.json:

Wiring elements via Livewire

Along with HTML attributes, Tailwire also allows you to wire up your elements to make them reactive via Livewire. The method names are specified according to Livewire attribute conventions, which can be found here: Laravel Livewire docs

Modelling data

Tailwire components contain a public $model array which will contain the data that is modelled through elements like inputs, selects, etc.

You can grab the data using the $this->model() helper method:

If your modelled data is an array, you can use the dot notation to grab values from the array:

You validate the $model data using $this->validate():

When checking for validation errors, you can use the $this->error() method to check if a validation error exists for the modelled data:

Performing actions

As you can see, you can wire up particular actions via the wire* methods as well. This includes things like clicking, polling, submitting, etc. If your action uses parameters, simply specify them in the wire* method:

The beauty of this is that it allows you to keep all of your logic inside the Tailwire component classes themselves! No more switching between tons of files and languages and wondering where things happen.

Using directives & other methods

The View $v variable also allows you to use some handy directives inside your view method, such as if statements, each loops, includes, and more.

If statements

Each loops

Including partial components

Heroicons (list of available icons here)

Swipe down to refresh indicator (for iOS PWA's)

Infinite scrolling indicator

Extras

Swipe down refresh

If a user has scrolled -100px from the top of the page, the swipeDownRefresh element will display briefly before the entire page is reloaded. This is useful for PWA's, when the user adds your web app to their home screen and needs a way to refresh the page.

Infinite scrolling

Each Tailwire component contains a $perPage public property which is incremented if the hidden infiniteScroll element is present on the page and the user scrolls 100px from the bottom. After it is incremented, the component should load more items and hide the infiniteScroll element again. See how query(), paginate(), count(), and $perPage are used in the example above.

Honeypot spam prevention

Tailwire uses Honey for spam bot prevention. See the repo for that package for more information. You can also use recaptcha by passing true to the element:


All versions of tailwire with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
barryvdh/laravel-ide-helper Version ^2.0
blade-ui-kit/blade-heroicons Version ^0.3
doctrine/dbal Version ^3.0
jamesmills/laravel-timezone Version ^1.9
laravel/framework Version ^8.0
livewire/livewire Version ^2.0
lukeraymonddowning/honey Version ^0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package redbastie/tailwire contains the following files

Loading the files please wait ....