Coder Social home page Coder Social logo

livewire-flash's People

Contributors

laravel-shift avatar mattlibera avatar mul14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

livewire-flash's Issues

Call to a member function livewire() on null

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.

Question serviceProvider

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');
    }

Livewire 2.x

(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.

[Request] Add autodismiss option

Hello, good package! First of all, thank you for your work.

I think it would be interesting to include a auto-dismiss option.

Dynamic classes not best practice with tailwind

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:

Screen Shot 2022-05-18 at 8 35 43 PM

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.

Dismiss button on flash message will submit forms

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);

Modals not supported

Backward compatibility with laracasts/flash is not available for modals (using ->overlay(). Should look at implementing a Tailwind / Livewire modal.

Method success() not found

I'm using this:
flash('Your request was successful!')->success()->livewire($this);

And in fact, I don't see success function

Clear flash messages

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();

The component is not styled.

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.

image

Code generated in the browser by the <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>

What i tried

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.

Cannot set message to be non-dismissable

Expected behavior:

  • When using dismissable(false) or notDismissable() on a flash message, the message is rendered without an [x] button to close it.

Actual behavior:

  • The [x] button remains visible regardless of whether it has been set to non-dismissable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.