mattlibera / livewire-flash Goto Github PK
View Code? Open in Web Editor NEWA Laravel Livewire-based Flash message component
License: MIT License
A Laravel Livewire-based Flash message component
License: MIT License
Hi,
Probably missing something trivial.
Add this --flash('Your request was successful!')->success()->livewire($this); -- to function resulting in the above issue.
Thanks for any help.
Hello,
this is a question, why this code in the boot of your serviceProvider, is it really needed ?
public function boot()
{
$this->mergeConfigFrom(__DIR__. '/publish/livewire-flash.php', 'livewire-flash');
$this->loadViewsFrom(__DIR__ . '/views', 'livewire-flash');
$this->publishes([
__DIR__ . '/publish' => config_path()
]);
Livewire::component('flash-container', \MattLibera\LivewireFlash\Livewire\FlashContainer::class);
Livewire::component('flash-message', \MattLibera\LivewireFlash\Livewire\FlashMessage::class);
\Blade::component('livewire-flash::alert', 'livewire-flash::alerts.base');
}
(I was trying
composer require mattlibera/livewire-flash
Using version ^0.3.1 for mattlibera/livewire-flash
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Can only install one of: livewire/livewire[1.x-dev, v2.1.2].
- Can only install one of: livewire/livewire[v2.1.2, 1.x-dev].
- Can only install one of: livewire/livewire[1.x-dev, v2.1.2].
- mattlibera/livewire-flash v0.3.1 requires livewire/livewire ^1.2 -> satisfiable by livewire/livewire[1.x-dev].
- Installation request for mattlibera/livewire-flash ^0.3.1 -> satisfiable by mattlibera/livewire-flash[v0.3.1].
- Installation request for livewire/livewire (locked at v2.1.2, required as ^2.0) -> satisfiable by livewire/livewire[v2.1.2].
Installation failed, reverting ./composer.json to its original content.
Hello, good package! First of all, thank you for your work.
I think it would be interesting to include a auto-dismiss option.
Per tailwind's recommendations, injecting dynamic classes cannot be injected with variables, as the tailwind compiler will have no way to pull those classes in:
Rather than stuffing a bunch of classes into a config file, it would be better to simply utilize separate templates for the various notification levels/statuses. As it currently exists, styles for the various colors don't get populated by the tailwind compiler unless they've also been used elsewhere not as variables.
Instead, I recommend doing away with the config file entirely, since there isn't any functionality configuration in it, and instead simply make the views publishable so they can be overridden.
When used inside a form with wire:submit.prevent, I clicked on the cross to dismiss the flash message but instead it attempts to resubmit the form.
The flash message close button attempts to submit the form.
flash('')->success()->livewire($this)
This does not happen when using overlay.
flash()->overlay('', '<title>')->livewire($this);
Backward compatibility with laracasts/flash
is not available for modals (using ->overlay()
. Should look at implementing a Tailwind / Livewire modal.
I'm using this:
flash('Your request was successful!')->success()->livewire($this);
And in fact, I don't see success function
How can I clear the flash messages?
I use modal from https://github.com/wire-elements/modal
Open with [$emit](wire:click="$emit('openModal', 'videos.edit'}})")
After saving call:
`flash('Your video have been created successfully')->livewire($this);
$this->closeModal();
But how can I clear the messages from inside the modal component? Currently they're appending each time I save. I've tried this but it doesn't work
$notifier = app('lwflash');
$notifier->clear();
In the child component action I put flash('Your request was successful!')->success()->livewire($this);
and in the parent component I put <livewire:flash-container />
.
The message is displayed without any alignment.
<livewire:flash-container />
component<section wire:id="2TUwewW4cwGXsLh7VCG7">
<div wire:id="XRtWV3FmnkEyRH1lQODa">
<div class="rounded-r-md bg-green-100 p-4 border-l-4 border-green-400 mb-3">
<div class="flex">
<div class="flex-shrink-0">
<p class="text-green-400">
<i class="fas fa-check"></i>
</p>
</div>
<div class="ml-3 text-sm leading-5 font-medium text-green-800">
Your request was successful!
</div>
<div class="ml-auto pl-3">
<div class="-mx-1.5 -my-1.5">
<button type="button" class="inline-flex rounded-md p-1.5 text-green-800 focus:outline-none transition ease-in-out duration-150" wire:click="dismiss">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Livewire Component wire-end:XRtWV3FmnkEyRH1lQODa -->
</section>
With the <div class="ml-3 text-sm leading-5 font-medium text-green-800">Your request was successful!</div>
element selected I searched for the text-green-800
class in Google Chrome's Styles tab, but no element was shown. Different for example from the ml-3
class that appears.
Also tried the command php artisan vendor:publish --provider="MattLibera\LivewireFlash\LivewireFlashServiceProvider"
and it didn't solve the problem.
I followed this tutorial https://stackoverflow.com/a/66828581
to install Tailwind and Font Awesome. The problem has not been resolved.
Hi,
Any plans on updating it for Livewire3?
Kind regards,
Expected behavior:
dismissable(false)
or notDismissable()
on a flash message, the message is rendered without an [x] button to close it.Actual behavior:
Hi, nice package!
I think there should be a group property to allow different flash messages at different places.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.