Download the PHP package bastinald/ui without Composer

On this page you can find all versions of the php package bastinald/ui. 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 ui

bastinald/ui

Laravel Livewire & Bootstrap 5 UI & CRUD starter kit. This package is a modernized version of the old laravel/ui package for developers who prefer using Bootstrap 5 and full page Livewire components to build their projects. It also comes with a few features to boost your development speed even more.

Requirements

Features

Documentation

Installation

This package was designed to work with fresh Laravel projects.

Install Laravel via Valet, Docker, or whatever you prefer:

Configure the .env app, database, and mail variables:

Require this package via composer:

Run the ui:install command:

Once the installation is complete, you should be able to visit your app URL and login with [email protected] as the email, and password as the password. This was seeded for you to test with.

Commands

Installing UI

This command will create your Livewire auth components & views, update your User model & factory, migrate & seed a default User, configure Bootstrap 5 JavaScript & SCSS through NPM/Webpack, create an IDE helper file, and run the necessary NPM commands.

Making Models

This will make a model with an automatic migration method included. It will also make a factory for the model whose definition points to the model definition method.

Use the --force to overwrite existing models & factories.

Making Components

This will make a Livewire component and view depending on which option you pass to it. Use the -f option to create a full page component with a route method, the -m option to create a modal component, or neither to create a partial component.

Use the --force to overwrite existing components & views.

Making CRUD

This will make CRUD components & views for a given component path/namespace. This includes an index, create, read, update, and delete. It also comes with searching, sorting, and filtering, which is easily customizable inside the index component class.

For making CRUD inside of subfolders, simply use slashes or dot notation:

If the model (e.g. User in the example above) does not already exist when making CRUD, it will ask if you want to make it. After generating CRUD, all you need to do is add your model fields to the component views. Check out the Users component & views that come with the package when you run ui:install for an example.

Use the --force to overwrite existing CRUD components & views.

Running Automatic Migrations

This command goes through your model migration methods and compares their schema's with the existing database table schema's. If any changes need to be made, it applies them automatically via Doctrine.

This command works well alongside traditional migration files. When you run this command, it will run your traditional migrations first, and the automatic migrations after. This is useful for cases where you don't need to couple a database table with a model (pivots, etc.).

Use the -f option to wipe the database (fresh), and the -s option to run your seeders after migration is complete. The --force is required to run migrations in production environments.

Automatic Migrations

This package promotes the usage of automatic migrations.

To use automatic migrations, specify a migration method inside your models:

Or, make a new model via the ui:model command, which will include a migration method for you:

The migration method uses the $table Blueprint variable, just like in traditional Laravel migration files. As mentioned previously, when you run the ui:migrate command, it will compare your existing database table schema's to your model migration methods and apply the necessary changes via Doctrine. With this, you'll no longer have to manage tons of migration files.

Automatic Routing

This package also promotes the usage of automatic routing.

To use automatic routing, specify a route method inside your full page Livewire components:

Or, just run the ui:component command with the -f option to quickly make a full page component including a route method:

The route method returns the Laravel Route facade, just like you would use in route files. This means that your component route can do anything a normal Laravel route can do. These routes are registered through the package service provider automatically, so you'll no longer have to manage messy route files.

Automatic Attribute Hashing

The HasHashes traits allows you to specify model attributes you want to hash automatically when they are saving to the database.

To use automatic hashing, use the HashHashes trait and specify a hashes property with the attributes that should be automatically hashed:

This trait will only automatically hash attribute values that are not already hashed, so it will not slow down seeders.

Form Data Manipulation

The WithModel traits makes managing form data inside your Livewire components easy. Normally, you'd have to specify a property for every one of your form inputs. With this trait, all of your form data will be present in a $model property array. This trait also comes with some handy methods to get, set, and validate the data.

Binding Model Data

Please note that all of the package x-ui Blade components will properly map the inputs to the component $model property and show relevant errors. If you are using your own HTML inputs, just be sure to prepend model. to the wire:model attribute.

For example, if you're using the package components, just specify the $model key directly via the model attribute:

If you're using your own HTML inputs, make sure you prepend model. to the wire:model.* attribute:

Notice how you don't prepend model. to the @error. Error messages use the $model key via the validateModel method, so you only need to prepend model. on the inputs.

Getting Model Data

Getting all model data as an array:

Getting an array of data:

If you pass an array to the getModel property, it will always return an array, even if you only use a single key. This is useful for quickly updating a single model column via create or update.

Getting a single value:

You can specify a default value via the second parameter, or omit it entirely.

Setting Model Data

Setting an array of values:

Setting a single value:

Resetting Model Data

You can reset all model data easily:

Validating Model Data

The validateModel method works the same as the Livewire validate method, but will use the $model data for validation.

You can use it alongside a rules method:

Or by itself, with rules passed directly:

Dynamic Bootstrap Modals

This package allows you to show Livewire components as modals dynamically by emitting a simple event. No more having to manage modal components everywhere in your views.

Making Modals

Just use the ui:component command with the -m option to make a new modal component:

This will create a partial Livewire component and a view that contains the Bootstrap modal classes.

Showing Modals

To show modals, just emit the showModal event.

You can emit this from your component views:

Or from the component classes themselves:

Notice that the second parameter is using the Livewire component class alias. So in this example, auth.password-change actually points to the Auth\PasswordChange component.

Passing Mount Parameters

You can pass any parameters you want to your modal component mount method by specifying them in the showModal event:

Passing parameters via component views:

Or from a component class:

Now, in our component mount method, we can use this parameter:

Notice how even model binding works here. If you need to pass more than one parameter, just keep adding them to the showModal emit, separated by a comma.

Hiding Modals

Hide the currently open modal via the hideModal event:

Or, through component classes:

You can also hide the modal through regular Bootstrap data-bs-toggle buttons:

Blade Components

This package comes with some handy Blade components, ensuring that you stay DRY, while keeping your markup nice and neat.

Input

A form input:

Available props:

If lazy and debounce are not used, defer is the default.

Textarea

A textarea input:

Available props:

The lazy and debounce props work the same as the input component.

Select

A select input:

Available props:

The options array can be an indexed or associative array. If the array is associative, the array keys will be used for the option values, and the array values will be used for the option labels. If the array is indexed, it's values will be used for both the option values and labels.

Radio

A radio input:

Available props:

The options array works the same as the select component.

Checkbox

A checkbox input:

Available props:

Dropdown

A dropdown button:

Available props:

Dropdown Item

A dropdown item button:

Available props:

Action

A CRUD action button:

Available props:

Pagination

Responsive pagination links:

Available props:

Icon

A Font Awesome icon:

Available props:

Font Awesome Icons

When running the ui:install command, you are given the option to install Font Awesome free or pro. If you select pro, you are required to have a global NPM token configured.

For information on how to configure this token, please see the Font Awesome documentation.

Publishing Assets

Publish the package config, stubs, and views via the vendor:publish command:

Select ui:config, ui:stubs, ui:views, or ui for all assets.

Using Custom Stubs

Once you have published the package config and stub files, the stubs will be located in the resources/stubs/vendor/ui folder.

Update the config/ui.php file and point the stub_path to this path:

The commands will now use this path for the stubs. Customize them to your needs.


All versions of ui with dependencies

PHP Build Version
Package Version
Requires barryvdh/laravel-ide-helper Version ^2.10
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 bastinald/ui contains the following files

Loading the files please wait ....