Last active
November 17, 2023 01:55
-
-
Save djaiss/d90ddf7ab3d675b2b2240daf898dfef8 to your computer and use it in GitHub Desktop.
Laravel flash notification with alpine which hide after a while
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if (session('error')) | |
<div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 3000)" class="pt-6 mx-auto max-w-xl px-2 sm:px-6 lg:px-8"> | |
<div class="flex items-center overflow-hidden border border-red-200 bg-white shadow-sm dark:bg-gray-800 rounded sm:rounded-lg"> | |
<div class="px-2 py-2 bg-orange-100 mr-2"> | |
<x-heroicon-o-light-bulb class="h-5 w-5 text-red-500" /> | |
</div> | |
<p>{{ session('error') }}</p> | |
</div> | |
</div> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment