Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tony98ms/livewire-interactions
Package to generate interactions in a Laravel application with Livewire
https://github.com/tony98ms/livewire-interactions
Last synced: 5 days ago
JSON representation
Package to generate interactions in a Laravel application with Livewire
- Host: GitHub
- URL: https://github.com/tony98ms/livewire-interactions
- Owner: tony98ms
- License: mit
- Created: 2022-03-15T19:25:30.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T19:53:17.000Z (almost 3 years ago)
- Last Synced: 2024-12-11T08:19:20.401Z (25 days ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Livewire Interactions
[![Latest Stable Version](http://poser.pugx.org/tonystore/livewire-interactions/v)](https://packagist.org/packages/tonystore/livewire-interactions) [![Total Downloads](http://poser.pugx.org/tonystore/livewire-interactions/downloads)](https://packagist.org/packages/tonystore/livewire-interactions) [![License](http://poser.pugx.org/tonystore/livewire-interactions/license)](https://packagist.org/packages/tonystore/livewire-interactions) [![PHP Version Require](http://poser.pugx.org/tonystore/livewire-interactions/require/php)](https://packagist.org/packages/tonystore/livewire-permission)
Package to generate interactions in a Laravel application with Livewire.
## REQUIREMENTS
- [PHP >= 7.4](http://php.net)
- [Laravel 7 | 8 | 9](https://laravel.com)
- [Livewire](https://laravel-livewire.com)
- [Laravel Follow](https://github.com/overtrue/laravel-follow)
- [Bootstrap 4.5 | 4.6 | 5](https://getbootstrap.com) or [Tailwind](https://tailwindcss.com)## INSTALLATION VIA COMPOSER
### Step 1: Composer
Run this command line in console.
``` bash
composer require tonystore/livewire-interactions
```
### Step 2: Publish Assets
#### Publish Config File
``` bash
php artisan vendor:publish --provider="Tonystore\LivewireInteraction\LivewireInteractionProvider" --tag=config-interaction
```
#### Publish Lang
Publish the translations in case you wish to modify any of them.
``` bash
php artisan vendor:publish --provider="Tonystore\LivewireInteraction\LivewireInteractionProvider" --tag=langs-interaction
```
## Usage
By default, Bootstrap is the default theme to use for the follow component.But you can switch to Tailwind.```php
'bootstrap',
];
```
You can customize the default styles applied to the follow component by following the instructions below.```php
[ // Bootstrap styles
'btn' => [
'follow_class' => 'btn btn-info btn-sm',
'unfollow_class' => 'btn btn-danger btn-sm'
],
'icon' => [
'follow_icon' => 'fas fa-user-plus',
'unfollow_icon' => 'fas fa-user-xmark'
]
],
];
```
To use the follow and unfollow component, you can add it anywhere in your code as follows:```html
//INSERT COMPONENT
//OR BLADE DIRECTIVE
@livewire('follow', ['user' => $jugador], key($user->id))
//The user parameter is mandatory.
```You can also customize the styles to be used directly in a component, passing as parameters the new settings to be used.
```html
```