toastr.blade.php 412 B

123456789
  1. @if(session()->has('dcat-admin-toastr'))
  2. @php
  3. $toastr = session('dcat-admin-toastr');
  4. $type = $toastr->get('type')[0] ?? 'success';
  5. $message = $toastr->get('message')[0] ?? '';
  6. $options = admin_javascript_json($toastr->get('options', []));
  7. @endphp
  8. <script>$(function () { toastr.{{$type}}('{!! $message !!}', null, {!! $options !!}); })</script>
  9. @endif