Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vojislavd/laravel-messages
Laravel package - Messages system based on TALL stack
https://github.com/vojislavd/laravel-messages
alpinejs laravel laravel-package livewire tailwindcss
Last synced: 3 months ago
JSON representation
Laravel package - Messages system based on TALL stack
- Host: GitHub
- URL: https://github.com/vojislavd/laravel-messages
- Owner: VojislavD
- License: mit
- Archived: true
- Created: 2022-03-10T14:24:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-08T08:40:00.000Z (over 1 year ago)
- Last Synced: 2024-09-25T20:43:17.113Z (3 months ago)
- Topics: alpinejs, laravel, laravel-package, livewire, tailwindcss
- Language: PHP
- Homepage:
- Size: 141 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Messages System
---
This package adds messages system to Laravel application based on TALL stack (Tailwind CSS, Alpine.js, Laravel, Livewire).
## Requirments
This package is compatible with Laravel Jetstream package for Livewire stack. If you have it installed and working there are no further steps required.
If you don't have Laravel Jetstream, you need to have some sort of authentication because the package use Laravels Authenticatable class to get authenticated user.
Also, you need to have already installed and working Tailwind CSS, Alpine.js and Livewire.## Installation
You can install the package via composer:
```bash
composer require vojislavd/laravel-messages
```After that you need to publish migrations and config files:
```bash
php artisan vendor:publish --tag="laravel-messages-migrations"
``````bash
php artisan vendor:publish --tag="laravel-messages-config"
```Run migration:
```bash
php artisan migrate
```In your User model class add `Messagable` trait:
```php
// App\Models\User.phpuse VojislavD\LaravelMessages\Traits\Messagable;
class User extends Authenticatable
{
use Messagable;...
}
```In `tailwind.config.js` file add blade files from this package:
```js
module.exports = {
content: [
'./vendor/vojislavd/laravel-messages/**/*.blade.php', // <-- Add this line
],theme: {},
plugins: [],
};
```Install dependencies and run build process:
```bash
npm install && npm run dev
```## Usage
Include the component to your HTML page:
```html
@livewire('inbox')
```
### Auto Refresh Messages
In config file `config\messages.php` you can configure component to automatically refresh and to get new messages, also you can configure refresh interval.```php
'update' => [
'auto' => true,
'interval' => 750 // milliseconds
],
```By default, auto refresh option is disabled.
### Filter Forbidden Words
The Component has a basic filter for forbidden words. In config file you can configure words to be filtered with option to filter exact words or contain text.```php
'validation' => [
'filter' => [
'exact' => ['exact', 'forbidden', 'words'],
'contain' => ['contain', 'forbidden', 'words'],
],
],
```### Change Style Of Component
If you want to change style of component, you need to publish view file.
```bash
php artisan vendor:publish --tag="laravel-messages-views"
```## Testing
Run tests with:```bash
composer test
```## Credits
- [Vojislav Dragicevic](https://vojislavd.com/)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.