Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

Overview

Build Status Total Downloads Total Downloads Latest Stable Version License

About Wire Elements Modal

Wire Elements Modal is a Livewire component that provides you with a modal that supports multiple child modals while maintaining state.

Installation

Click the image above to read a full article on using the Wire Elements modal package or follow the instructions below.

To get started, require the package via Composer:

composer require wire-elements/modal

Livewire directive

Add the Livewire directive @livewire('livewire-ui-modal') directive to your template.

<html>
<body>
    <!-- content -->

    @livewire('livewire-ui-modal')
</body>
</html>

Alpine

Livewire Elements Modal requires Alpine. You can use the official CDN to quickly include Alpine:

<!-- Alpine v2 -->
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script>

<!-- Alpine v3 -->
<script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>

TailwindCSS

The base modal is made with TailwindCSS. If you use a different CSS framework I recommend that you publish the modal template and change the markup to include the required classes for your CSS framework.

php artisan vendor:publish --tag=livewire-ui-modal-views

Creating a modal

You can run php artisan make:livewire EditUser to make the initial Livewire component. Open your component class and make sure it extends the ModalComponent class:

<?php

namespace App\Http\Livewire;

use LivewireUI\Modal\ModalComponent;

class EditUser extends ModalComponent
{
    public function render()
    {
        return view('livewire.edit-user');
    }
}

Opening a modal

To open a modal you will need to emit an event. To open the EditUser modal for example:

<!-- Outside of any Livewire component -->
<button onclick="Livewire.emit('openModal', 'edit-user')">Edit User</button>

<!-- Inside existing Livewire component -->
<button wire:click="$emit('openModal', 'edit-user')">Edit User</button>

<!-- Taking namespace into account for component Admin/Actions/EditUser -->
<button wire:click="$emit('openModal', 'admin.actions.edit-user')">Edit User</button>

Passing parameters

To open the EditUser modal for a specific user we can pass the user id (notice the single quotes):

<!-- Outside of any Livewire component -->
<button onclick='Livewire.emit("openModal", "edit-user", {{ json_encode(["user" => $user->id]) }})'>Edit User</button>

<!-- Inside existing Livewire component -->
<button wire:click='$emit("openModal", "edit-user", {{ json_encode(["user" => $user->id]) }})'>Edit User</button>

<!-- If you use a different primaryKey (e.g. email), adjust accordingly -->
<button wire:click='$emit("openModal", "edit-user", {{ json_encode(["user" => $user->email]) }})'>Edit User</button>

<!-- Example of passing multiple parameters -->
<button wire:click='$emit("openModal", "edit-user", {{ json_encode([$user->id, $isAdmin]) }})'>Edit User</button>

The parameters are passed to the mount method on the modal component:

<?php

namespace App\Http\Livewire;

use App\Models\User;
use LivewireUI\Modal\ModalComponent;

class EditUser extends ModalComponent
{
    public User $user;

    public function mount(User $user)
    {
        Gate::authorize('update', $user);
        
        $this->user = $user;
    }

    public function render()
    {
        return view('livewire.edit-user');
    }
}

Opening a child modal

From an existing modal you can use the exact same event and a child modal will be created:

<!-- Edit User Modal -->

<!-- Edit Form -->

<button wire:click='$emit("openModal", "delete-user", {{ json_encode(["user" => $user->id]) }})'>Delete User</button>

Closing a (child) modal

If for example a user clicks the 'Delete' button which will open a confirm dialog, you can cancel the deletion and return to the edit user modal by emitting the closeModal event. This will open the previous modal. If there is no previous modal the entire modal component is closed and the state will be reset.

<button wire:click="$emit('closeModal')">No, do not delete</button>

You can also close a modal from within your modal component class:

<?php

namespace App\Http\Livewire;

use App\Models\User;
use LivewireUI\Modal\ModalComponent;

class EditUser extends ModalComponent
{
    public User $user;

    public function mount(User $user)   
    {
        Gate::authorize('update', $user);
        
        $this->user = $user;
    }

    public function update()
    {
        Gate::authorize('update', $user);
            
        $this->user->update($data);

        $this->closeModal();
    }

    public function render()
    {
        return view('livewire.edit-user');
    }
}

If you don't want to go to the previous modal but close the entire modal component you can use the forceClose method:

public function update()
{
    Gate::authorize('update', $user);
    
    $this->user->update($data);

    $this->forceClose()->closeModal();
}

Often you will want to update other Livewire components when changes have been made. For example, the user overview when a user is updated. You can use the closeModalWithEvents method to achieve this.

public function update()
{
    Gate::authorize('update', $user);
    
    $this->user->update($data);

    $this->closeModalWithEvents([
        UserOverview::getName() => 'userModified',
    ]);
}

It's also possible to add parameters to your events:

public function update()
{
    $this->user->update($data);

    $this->closeModalWithEvents([
        UserOverview::getName() => ['userModified', [$this->user->id],
    ]);
}

Changing modal properties

You can change the width (default value '2xl') of the modal by overriding the static modalMaxWidth method in your modal component class:

/**
 * Supported: 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl'
 */
public static function modalMaxWidth(): string
{
    return 'xl';
}

By default, the modal will close when you hit the escape key. If you want to disable this behavior to, for example, prevent accidentally closing the modal you can overwrite the static closeModalOnEscape method and have it return false.

public static function closeModalOnEscape(): bool
{
    return false;
}

By default, the modal will close when you click outside the modal. If you want to disable this behavior to, for example, prevent accidentally closing the modal you can overwrite the static closeModalOnClickAway method and have it return false.

public static function closeModalOnClickAway(): bool
{
    return false;
}

By default, closing a modal by pressing the escape key will force close all modals. If you want to disable this behavior to, for example, allow pressing escape to show a previous modal, you can overwrite the static closeModalOnEscapeIsForceful method and have it return false.

public static function closeModalOnEscapeIsForceful(): bool
{
    return false;
}

When a modal is closed, you can optionally enable a modalClosed event to be fired. This event will be fired on a call to closeModal, when the escape button is pressed, or when you click outside the modal. The name of the closed component will be provided as a parameter;

public static function dispatchCloseEvent(): bool
{
    return true;
}

By default, when a child modal is closed, the closed components state is still available if the same modal component is opened again. If you would like to destroy the component when its closed you can override the static destroyOnClose method and have it return true. When a destroyed modal is opened again its state will be reset.

public static function destroyOnClose(): bool
{
    return true;
}

Skipping previous modals

In some cases you might want to skip previous modals. For example:

  1. Team overview modal
  2. -> Edit Team
  3. -> Delete Team

In this case, when a team is deleted, you don't want to go back to step 2 but go back to the overview. You can use the skipPreviousModal method to achieve this. By default it will skip the previous modal. If you want to skip more you can pass the number of modals to skip skipPreviousModals(2).

<?php

namespace App\Http\Livewire;

use App\Models\Team;
use LivewireUI\Modal\ModalComponent;

class DeleteTeam extends ModalComponent
{
    public Team $team;

    public function mount(Team $team)
    {
        $this->team = $team;
    }

    public function delete()
    {
        Gate::authorize('delete', $this->team);
        
        $this->team->delete();

        $this->skipPreviousModal()->closeModalWithEvents([
            TeamOverview::getName() => 'teamDeleted'
        ]);
    }

    public function render()
    {
        return view('livewire.delete-team');
    }
}

You can also optionally call the destroySkippedModals() method to destroy the skipped modals so if any are opened again their state will be reset

Building Tailwind CSS for production

To purge the classes used by the package, add the following lines to your purge array in tailwind.config.js:

'./vendor/wire-elements/modal/resources/views/*.blade.php',
'./storage/framework/views/*.php',

Because some classes are dynamically build you should add some classes to the purge safelist so your tailwind.config.js should look something like this:

module.exports = {
  purge: {
    content: [
      './vendor/wire-elements/modal/resources/views/*.blade.php',
      './storage/framework/views/*.php',
      './resources/views/**/*.blade.php',
    ],
    options: {
      safelist: [
        'sm:max-w-2xl'
      ]
    }
  },
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

Configuration

You can customize the Modal via the livewire-ui-modal.php config file. This includes some additional options like including CSS if you don't use TailwindCSS for your application, as well as the default modal properties.

To publish the config run the vendor:publish command:

php artisan vendor:publish --tag=livewire-ui-modal-config
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Include CSS
    |--------------------------------------------------------------------------
    |
    | The modal uses TailwindCSS, if you don't use TailwindCSS you will need
    | to set this parameter to true. This includes the modern-normalize css.
    |
    */
    'include_css' => false,


    /*
    |--------------------------------------------------------------------------
    | Include JS
    |--------------------------------------------------------------------------
    |
    | Livewire UI will inject the required Javascript in your blade template.
    | If you want to bundle the required Javascript you can set this to false
    | and add `require('vendor/wire-elements/modal/resources/js/modal');`
    | to your script bundler like webpack.
    |
    */
    'include_js' => true,


    /*
    |--------------------------------------------------------------------------
    | Modal Component Defaults
    |--------------------------------------------------------------------------
    |
    | Configure the default properties for a modal component.
    | 
    | Supported modal_max_width
    | 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl'
    */
    'component_defaults' => [
        'modal_max_width' => '2xl',
        
        'close_modal_on_click_away' => true,

        'close_modal_on_escape' => true,

        'close_modal_on_escape_is_forceful' => true,

        'dispatch_close_event' => false,
        
        'destroy_on_close' => false,
    ],
];

Security

If you are new to Livewire I recommend to take a look at the security details. In short, it's very important to validate all information given Livewire stores this information on the client-side, or in other words, this data can be manipulated. Like shown in the examples above, use the Guard facade to authorize actions.

Credits

License

WireElements is open-sourced software licensed under the MIT license.

Manage your Laravel Horizon Instances With Observer

All your favorite Laravel Horizon features (and a few new ones) are packed into a single desktop application. A must-have productivity booster for every Laravel developer. Click here to get Observer

Comments
  • Adds modal version with bootstrap without jquery

    Adds modal version with bootstrap without jquery

    This PR supports using the bootstrap package in version 4.6 and 5 without using Jquery.

    Some changes were made in the Modal component and in the modal.js file and also in the tests to be able to call 3 variables that bootstrap controls.

    By default I put a configuration file for the user to select the css framework of their choice, but tailwind will be loaded without configuration.

    opened by luanfreitasdev 23
  • Model doesn't open

    Model doesn't open

    I have a modal defined, but while clicking on this link triggers the event (I can pick it up in an event listener) the modal never appears. Any ideas?

    <a onclick="Livewire.emit("openModal", "personal.request-modals.accept-sharing-request-modal", {"item":"abc123"})" href="#" class="...">
        Accept and share
    </a>
    

    The modal controller is App\Controllers\Livewire\Personal\RequestModals\AcceptSharingRequestModal.

    opened by xtfer 14
  • Opening modal from blade component

    Opening modal from blade component

    Hey, thanks for making such a great package. Super simple to use.

    I have setup a button to trigger a modal, passing a value from the page I am on:

    <button 
    class="bg-blue-500 text-white p-4"
    onclick='Livewire.emit("openModal", "create-document", {{ json_encode(["setComponent" => $component->id]) }})'>
    Upload Document
    </button>
    

    This works perfectly, passes the data I want. Great!

    We are using blade components on the site to keep the styling of every button the same. So I use:

    <x-button
    type="button"
    name="Add New Document"
    color="primary"
    onclick="Livewire.emit('openModal', 'create-document')">
    Add a new document</x-button>
    

    This also works! But, when I try to pass a value, it breaks. I've tried (what I feel like) all sorts of different quote combinations as i saw your (notice the single quotes) comment in docs.

    <x-button
    type="button"
    name="Add New Document"
    color="primary"
    onclick='Livewire.emit("openModal", "create-document", {{ json_encode(["setComponent" => $component->id ]) }})'>
    Add a new document</x-button>
    
    <x-button
    type="button"
    name="Add New Document"
    color="primary"
    onclick="Livewire.emit('openModal', 'create-document', {{ json_encode(['setComponent' => $component->id ]) }}
    )">
    Add a new document</x-button>
    

    Am I missing something really obvious?

    Using version 1.0.0

    Thank you!

    opened by thetwopct 14
  • Error when update to 0.1.3

    Error when update to 0.1.3

    After an update to 0.1.3 i've this error in alpine, i've published the php artisan vendor:publish --tag=livewire-ui:views to make sure all was ok but still have an error

    Uncaught ReferenceError: modalWidth is not defined
        at eval (eval at d.el (alpine.js:144), <anonymous>:3:36)
        at d.el (alpine.js:144)
        at d (alpine.js:131)
        at f (alpine.js:139)
        at be.evaluateReturnExpression (alpine.js:1754)
        at T (alpine.js:673)
        at alpine.js:1717
        at Array.forEach (<anonymous>)
        at be.resolveBoundAttributes (alpine.js:1703)
        at be.initializeElement (alpine.js:1628)
    
    opened by labomatik 14
  •  Cannot read property 'get' of undefined

    Cannot read property 'get' of undefined

    This error happens whenever I click on a button to show the Modal. I am still able to see my modal though

    app.js:252 Uncaught (in promise) TypeError: Cannot read property 'get' of undefined at Proxy.getActiveComponentModalAttribute (app.js:252) at Proxy.setActiveModalComponent (app.js:283) at app.js:355 at #MessageBus.js:17 at Array.forEach () at MessageBus.value (MessageBus.js:16) at Object.emit (Store.js:52) at index.js:306 at Array.forEach () at Component.value (index.js:296) getActiveComponentModalAttribute @ app.js:252 setActiveModalComponent @ app.js:283 (anonymous) @ app.js:355 (anonymous) @ MessageBus.js:17 value @ MessageBus.js:16 emit @ Store.js:52 (anonymous) @ index.js:306 value @ index.js:296 value @ index.js:248 value @ index.js:7 (anonymous) @ index.js:58 Promise.then (async) (anonymous) @ index.js:53 Promise.then (async) value @ index.js:51 sendMessage @ index.js:221 value @ index.js:231 later @ debounce.js:8 setTimeout (async) (anonymous) @ debounce.js:12 value @ index.js:204 (anonymous) @ Store.js:55 emit @ Store.js:54 value @ index.js:57 onclick @ dashboard:516

    opened by omikronuk 11
  • Deployed via Forge - Requested an insecure script

    Deployed via Forge - Requested an insecure script

    Hi there

    First of all, thank you very much for this awesome package. I really enjoy using it and it has saved me a lot of time!

    I have some issues using the modals in production (on my server deployed by Laravel Forge). I encounter the following error:

    Mixed Content: The page at 'https://example.org/dashboard' was loaded over HTTPS, but requested an insecure script 'http://xx.xxx.xxx.xxx/vendor/livewire-ui/modal.js'. This request has been blocked; the content must be served over HTTPS.

    Where example.org and http://xx.xxx.xxx.xxx should be replaced with my domain name and my server IP address.

    I am using LetsEncrypt (installed via Forge) to ensure SSL. However, I am not sure why livewire-ui/modal is connecting via http

    opened by oliverbj 10
  • Does not recognize livewire component methods

    Does not recognize livewire component methods

    I have component Seach according to documentation

    This is the component view: <button wire:click="update()" type="button"> Update </button>

    This is a component code:

    <?php
    
    namespace App\Http\Livewire;
    
    use Illuminate\Support\Str;
    use LivewireUI\Modal\ModalComponent;
    use Livewire\WithPagination;
    use App\Models\Persona;
    
    class Search extends ModalComponent
    {
        use WithPagination;
        public $searchTerm;
    
        public function render()
        {
            $searchTerm = '%' . Str::upper($this->searchTerm) .'%';
            return view('livewire.search', [
                'personas' => Persona::where('nombre','like', $searchTerm)->paginate(15)
            ]);
        }
    
        public function update()
        {
            // Todo 
            $this->closeModal();
        }
    }
    

    This is a error: Unable to call component method. Public method [update] not found on component: [livewire-u-i.modal.modal]

    opened by nucarlos 10
  • Using Open Modal with powerGrid

    Using Open Modal with powerGrid

    Trows this error:

    [App\Http\Livewire\DeleteModal] does not implement [LivewireUI\Modal\Contracts\ModalComponent] interface.

    When checked, the CSS and JS files were not published

    using with PHP 8

    opened by abbasmashaddy72 9
  • Tailwind production build

    Tailwind production build

    When using tailwindcss as a package and building it with

    npm run dev
    

    Everything works fine. But when you want to only have the css of the classes been used and run

    npm run prod
    

    It is only showing the backdrop and not the modal because of some tailwind classes.

    Purge property in tailwind.config.js:

    purge: [
        './resources/**/*.blade.php',
        './resources/**/**/*.blade.php'
    ],
    
    opened by MarcelWeidum 9
  • Making max-width responsive

    Making max-width responsive

    Due to the sm:w-full in the modal's body from tailwind ui, you need a way to control the max-width or it will flicker out at smaller breakpoints if your size is too large.

    Size is being set here as only one class, but since it's css there is an easy win that doesn't require a huge programmatic change.

    https://github.com/livewire-ui/modal/blob/112b521bbd9eef4c188b9eaa0b274dbe424b6578/resources/js/modal.js#L37

    This can be modified to instead of just pushing in that one value, I'd use a look up table and pull it from there: here is a working one I tested.

    public static array $sizes = [
            'sm' => 'sm:max-w-sm',
            'md' => 'sm:max-w-md',
            'lg' => 'sm:max-w-md md:max-w-lg',
            'xl' => 'sm:max-w-md md:max-w-xl',
            '2xl' => 'sm:max-w-md md:max-w-xl lg:max-w-2xl',
            '3xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl',
            '4xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl',
            '5xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl',
            '6xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl',
            '7xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl',
        ]; 
    

    I used it in my own modal system, I was thinking of pulling in this one to solve my child model issue but there are two outstanding tickets that i need solved first. Luckily they both have simple fixes :)

    Hope this helps! I'm excited to start using this!

    opened by roni-estein 8
  • Undefined array key 1 when opening from function

    Undefined array key 1 when opening from function

    I'm opening a modal from a function on page load if a condition is met.

    Blade template:

    @if ($user->subscription?->latest_webhook == 'waiting')
        @push('scripts')
            <script>
                setTimeout(function() {
                    Livewire.emit('openModal', 'subscription-webhook-status');
                }, 800);
            </script>
        @endpush
    @endif
    

    This, sometimes, results in the following error:

    Undefined array key 1 (View: /resources/views/vendor/livewire-ui-modal/modal.blade.php)
    

    The highlighted error is within the file vendor/livewire/livewire/src/LivewireManager.php:399, the return $matches[1][0];.

    public function getRootElementTagName($dom)
    {
        preg_match('/<([a-zA-Z0-9\-]*)/', $dom, $matches, PREG_OFFSET_CAPTURE);
     
        return $matches[1][0];
    }
    
    

    Livewire, Wire Elements Modal and AlpineJS are using the latest version. Any idea what is causing this problem?

    opened by MrMooky 7
  • Please move maxWidths to config or consider adding Tailwind preffix support

    Please move maxWidths to config or consider adding Tailwind preffix support

    Issue: currently, maxWidths is hardcoded in /modal/src/ModalComponent.php as follows:

        protected static array $maxWidths = [
            'sm'  => 'sm:max-w-sm',
            'md'  => 'sm:max-w-md',
            'lg'  => 'sm:max-w-md md:max-w-lg',
            'xl'  => 'sm:max-w-md md:max-w-xl',
            '2xl' => 'sm:max-w-md md:max-w-xl lg:max-w-2xl',
            '3xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl',
            '4xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl',
            '5xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl',
            '6xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl',
            '7xl' => 'sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl',
        ];
    

    The thing is, there is no way to customize it. The thing is, I use Tailwind classes with tw- preffix in my code, so basically I have to adjust classes in modal.blade.php and modal.js with every new Wire Elements Modal version (overflow-y-hidden becomes tw-overflow-y-hidden in my code, for example).

    Please consider allowing us - as I said earlier - to override maxWidths in config, or, alternatively, consider adding Tailwind preffix support.

    Thanks!

    Update: I ended up overriding modalMaxWidthClass in my code, as a work-around (to add tw- preffix to any Tailwind class):

        public static function modalMaxWidthClass(): string
        {
            return str_replace(':', ':tw-', parent::modalMaxWidthClass());
        }
    
    opened by vladrusu 0
  • Modal is pushed to bottom of screen and cutoff on mobile devices

    Modal is pushed to bottom of screen and cutoff on mobile devices

    I'm testing this on my iPhone 10X and the modal appears at the bottom of the screen and a portion of the modal is cutoff, you have to scroll the modal up with your finger for it to fit on the screen. I've messed around with some of the stylings to see what's causing this but haven't been able to figure it out. Does anyone know what's causing this?

    IMG_4231

    opened by jringeisen 22
  • Enabling Tailwind CSS' JIT mode breaks modals on screen widths over 640px (sm breakpoint)

    Enabling Tailwind CSS' JIT mode breaks modals on screen widths over 640px (sm breakpoint)

    Setting mode: 'jit' in tailwind.config.js breaks modals on screen widths > 640px (Tailwind's sm breakpoint). Clicking a button to enable the modal does correctly fade in the backdrop, but the actual content is placed at the very bottom outside the screen.

    This only affects the modals when the sm:* classes are active. The modal content shows up fine on screen widths below 640px.

    I've found that a way to fix this is to purge './vendor/livewire-ui/modal/resources/**/*' rather than './vendor/livewire-ui/modal/resources/views/*.blade.php' in tailwind.config.js.

    JIT off (works as expected): image

    JIT on (broken, note the visible y overflow): image

    JIT on while purging './vendor/livewire-ui/modal/resources/**/*': Works as expected, same result as JIT off.

    The screenshots were taken on a fresh Laravel project with livewire-ui/[email protected] installed. Installed npm packages are [email protected], [email protected] and [email protected].

    The HelloWorld modal component was made as per the tutorial.

    tailwind.config.js purge contents are as instructed by the readme:

    module.exports = {
      purge: {
        content: [
          './vendor/livewire-ui/modal/resources/views/*.blade.php',
          './storage/framework/views/*.php',
          './resources/views/**/*.blade.php',
        ],
        options: {
          safelist: [
            'sm:max-w-2xl'
          ]
        }
      },
      // ...
    }
    

    webpack.mix.js (if relevant):

    const mix = require('laravel-mix');
    
    mix.js('resources/js/app.js', 'public/js')
        .postCss('resources/css/app.css', 'public/css', [
            require('postcss-import'),
            require('tailwindcss'),
            require('autoprefixer'),
        ]);
    

    welcome.blade.php:

    <html>
    <head>
    	  <link rel="stylesheet" href="{{ asset('css/app.css') }}">
    	  <script defer src="https://unpkg.com/[email protected]/dist/cdn.min.js"></script>
    	  @livewireStyles
    </head>
    <body>
    	<div class="h-screen grid place-content-center">
    		<button class="bg-gray-800 text-white p-4" onclick="Livewire.emit('openModal', 'hello-world')">Click me</button>
    	</div>
            
    	@livewire('livewire-ui-modal')
    	@livewireScripts
    </body>
    </html>
    
    opened by JulienZD 13
Releases(1.0.7)
  • 1.0.7(Jul 7, 2022)

    What's Changed

    • fixes loading speed issue by moving config reads away from View composer ... by @arukompas in https://github.com/wire-elements/modal/pull/239

    New Contributors

    • @arukompas made their first contribution in https://github.com/wire-elements/modal/pull/239

    Full Changelog: https://github.com/wire-elements/modal/compare/1.0.6...1.0.7

    Source code(tar.gz)
    Source code(zip)
  • 1.0.6(Apr 13, 2022)

    What's Changed

    • Add id to modal container by @ryangjchandler in https://github.com/wire-elements/modal/pull/198
    • Fix bug that would cause dozens of requests when pressing escape

    New Contributors

    • @ryangjchandler made their first contribution in https://github.com/wire-elements/modal/pull/198

    Full Changelog: https://github.com/wire-elements/modal/compare/1.0.5...1.0.6

    Source code(tar.gz)
    Source code(zip)
  • 1.0.5(Mar 3, 2022)

    What's Changed

    • Gate instead of Guard facade to authorize actions by @olivsinz in https://github.com/wire-elements/modal/pull/149
    • Fix flickering modal with Alpine 3.9.1 by @PhiloNL in https://github.com/wire-elements/modal/pull/193

    If you published modal.blade.php you will need to replace x-on:close.stop="show = false" with x-on:close.stop="setShowPropertyTo(false)" (see diff)

    New Contributors

    • @olivsinz made their first contribution in https://github.com/wire-elements/modal/pull/149

    Full Changelog: https://github.com/wire-elements/modal/compare/1.0.4...1.0.5

    Source code(tar.gz)
    Source code(zip)
  • 1.0.4(Jan 18, 2022)

    What's Changed

    • Updates to remove flashing/disappearing modal fixes issues 26 by @roni-estein in https://github.com/wire-elements/modal/pull/111
    • Fix modalWidthClass and add Exception by @PhiloNL in https://github.com/wire-elements/modal/pull/113
    • Add optional chaining to modal.js by @putera in https://github.com/wire-elements/modal/pull/132
    • Fix order of actions on closeModalWithEvents by @Hansterdam in https://github.com/wire-elements/modal/pull/117

    New Contributors

    • @roni-estein made their first contribution in https://github.com/wire-elements/modal/pull/111
    • @putera made their first contribution in https://github.com/wire-elements/modal/pull/132
    • @Hansterdam made their first contribution in https://github.com/wire-elements/modal/pull/117

    Full Changelog: https://github.com/wire-elements/modal/compare/1.0.3...1.0.4

    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Nov 5, 2021)

    What's Changed

    • Update path to vendor resources by @Wit3 in https://github.com/wire-elements/modal/pull/101
    • Add option to destroy the modal state by @thermiteplasma in https://github.com/wire-elements/modal/pull/95

    New Contributors

    • @Wit3 made their first contribution in https://github.com/wire-elements/modal/pull/101

    Full Changelog: https://github.com/wire-elements/modal/compare/1.0.2...1.0.3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Sep 6, 2021)

  • 1.0.0(Jul 5, 2021)

    v1.0.0 stable release 🚀

    Breaking changes to take into account:

    The @livewireUIScripts has been removed.

    Any required Javascript will be loaded inline. If you want to include the Javascript in your bundler like Webpack you can use the config to disable Javascript and require the necessary Javascript require('vendor/livewire-ui/modal/resources/js/modal');

    The package namespace has changed to livewire-ui-modal

    If you published the modal view make sure to make the required changes.

    Source code(tar.gz)
    Source code(zip)
  • 0.1.7(Jun 19, 2021)

    The setActiveModalComponent is sometimes called multiple times resulting in issues with the component history log and could result in errors. This release prevents an already active modal component to be set active (while it is already active).

    Source code(tar.gz)
    Source code(zip)
  • 0.1.6(Jun 8, 2021)

    • Add autofocus support
    • Add option to change escape behaviour
    • Add option to emit closed event

    By default, closing a modal by pressing the escape key will force close all modals. If you want to disable this behavior to, for example, allow pressing escape to show a previous modal, you can overwrite the static closeModalOnEscapeIsForceful method and have it return false.

    public static function closeModalOnEscapeIsForceful(): bool
    {
        return false;
    }
    

    When a modal is closed, you can optionally enable a modalClosed event to be fired. This event will be fired on a call to closeModal, when the escape button is pressed, or when you click outside the modal. The name of the closed component will be provided as a parameter;

    public static function dispatchCloseEvent(): bool
    {
        return true;
    }
    
    Source code(tar.gz)
    Source code(zip)
  • 0.1.5(May 4, 2021)

    Add option to disable closing modal on click a away:

        public static function closeModalOnClickAway(): bool
        {
            return false;
        }
    

    Change Alpine binding to prevent VueJS conflict https://github.com/livewire-ui/modal/commit/85acc51047ca34a7b269939aff96e7abe665fcf1

    Source code(tar.gz)
    Source code(zip)
  • 0.1.4(Apr 29, 2021)

  • 0.1.2(Apr 15, 2021)

    Allow emission of events with parameters and no target (https://github.com/livewire-ui/modal/commit/22e8e947a941ffe3e3cc23cdff460399d8673a7d)

    Source code(tar.gz)
    Source code(zip)
Owner
Wire Elements
Livewire components by @philoNL
Wire Elements
Dynamic Laravel Livewire Bootstrap 5 modals.

Laravel Livewire Modals Dynamic Laravel Livewire Bootstrap 5 modals. Requirements Bootstrap 5 Installation Require the package: composer require basti

null 55 Dec 27, 2022
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously github.com/hyn/multi-tenant

The unobtrusive Laravel package that makes your app multi tenant. Serving multiple websites, each with one or more hostnames from the same codebase. B

Tenancy 2.4k Jan 3, 2023
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups.

Tenancy for Laravel Enabling awesome Software as a Service with the Laravel framework. This is the successor of hyn/multi-tenant. Feel free to show su

Tenancy 1.1k Dec 30, 2022
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously

Tenancy 2.4k Jan 3, 2023
A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards.

TALL multiselect cards A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards. Table of content

Frederic Habich 19 Dec 14, 2022
This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

null 7 Nov 15, 2022
This tool gives you the ability to set the default collapse state for Nova 4.0 menu items.

Nova Menu Collapsed This tool gives you the ability to set the default collapse state for Nova 4.0 menu items. Requirements php: >=8.0 laravel/nova: ^

Artem Stepanenko 10 Nov 17, 2022
States allows you to create PHP classes following the State Pattern in PHP.

States allows you to create PHP classes following the State Pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability and workflows writing.

Teknoo Software 10 Nov 20, 2022
Laravel-comments-livewire - Livewire components for the laravel-comments package

Associate comments and reactions with Eloquent models This package contains Livewire components to be used with the spatie/laravel-comments package. S

Spatie 15 Jan 18, 2022
A laravel Livewire Dynamic Selects with multiple selects depending on each other values, with infinite levels and totally configurable.

Livewire Combobox: A dynamic selects for Laravel Livewire A Laravel Livewire multiple selects depending on each other values, with infinite levels of

Damián Aguilar 25 Oct 30, 2022
Laravel 9 Livewire Multiple Image Upload Example

Laravel livewire multiple image upload; Through this tutorial, i am going to show you how to upload multiple image using livewire in laravel apps.

Wesley Sinde 3 Feb 23, 2022
Chrome extension to generate Laravel integration tests while using your app.

Laravel TestTools Check out the introduction post about the chrome extension. Installation git clone [email protected]:mpociot/laravel-testtools.git # i

Marcel Pociot 473 Nov 1, 2022
LaravelFly is a safe solution to speeds up new or old Laravel 5.5+ projects, with preloading and coroutine, while without data pollution or memory leak

Would you like php 7.4 Preloading? Would you like php coroutine? Today you can use them with Laravel because of Swoole. With LaravalFly, Laravel will

null 456 Dec 21, 2022
Laravel Livewire full page component routing.

Laravel Livewire Routes Laravel Livewire full page component routing. This package allows you to specify routes directly inside your full page Livewir

null 22 Oct 6, 2022
Laravel Livewire form component with declarative Bootstrap 5 fields and buttons.

Laravel Livewire Forms Laravel Livewire form component with declarative Bootstrap 5 fields and buttons. Requirements Bootstrap 5 Installation composer

null 49 Oct 29, 2022
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Livewire UI 792 Jan 3, 2023
Laravel Livewire component to show Events in a good looking monthly calendar

Livewire Calendar This package allows you to build a Livewire monthly calendar grid to show events for each day. Events can be loaded from within the

Andrés Santibáñez 680 Jan 4, 2023
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Wire Elements 790 Dec 27, 2022
A dynamic table component for Laravel Livewire - For Slack access, visit:

A dynamic Laravel Livewire component for data tables. Bootstrap 4 Demo | Bootstrap 5 Demo | Tailwind Demo | Demo Repository Installation You can insta

Anthony Rappa 1.3k Jan 1, 2023