File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
resources/views/components Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ @if (session ()-> has (' message' ) )
2
+ @php
3
+ $message = session (' message' );
4
+ $parts = explode (' |' , $message , 2 );
5
+ $classType = json_decode ($parts [0 ], JSON_OBJECT_AS_ARRAY ) ?? [
6
+ ' border' => ' border-slate-500' ,
7
+ ' bg' => ' bg-slate-100' ,
8
+ ' text' => ' text-slate-500' ,
9
+ ]; // Default class if no '|' is present
10
+ $text = $parts [1 ] ?? $parts [0 ]; // If there's no '|', use the entire message as text
11
+ @endphp
12
+
13
+ <div class =" fixed bottom-4 md:bottom-8 left-0 right-0 mx-auto px-4 md:px-0 md:left-auto md:right-8 w-full md:w-2/6 z-100 transition duration-200"
14
+ x-data =" { showToastr: true }" x-init =" setTimeout(() => showToastr = false, 7500)" >
15
+
16
+ <div class =" bg-white border {{ $classType [' border' ] } } shadow-md rounded-lg py-2.5 px-4 flex items-center"
17
+ x-show =" showToastr" >
18
+ <div class =" {{ $classType [' bg' ] } } h-8 w-8 rounded-full inline-flex items-center justify-center mr-3" >
19
+ <x-icon name =" o-exclamation-circle" class =" {{ $classType [' text' ] } }" ></x-icon >
20
+ </div >
21
+ <span >{{ $text } } </span >
22
+ <x-icon x-on:click =" showToastr = false" name =" o-x"
23
+ class =" text-gray-500 p-1 w-6 h-6 ml-auto hover:text-gray-700 cursor-pointer" ></x-icon >
24
+ </div >
25
+ </div >
26
+ @endif
You can’t perform that action at this time.
0 commit comments