plugins.blade.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. @foreach(config('adminlte.plugins') as $pluginName => $plugin)
  2. {{-- Check whether the plugin is active --}}
  3. @php
  4. $plugSection = View::getSection('plugins.' . ($plugin['name'] ?? $pluginName));
  5. $isPlugActive = $plugin['active']
  6. ? ! isset($plugSection) || $plugSection
  7. : ! empty($plugSection);
  8. @endphp
  9. {{-- When the plugin is active, include its files --}}
  10. @if($isPlugActive)
  11. @foreach($plugin['files'] as $file)
  12. {{-- Setup the file location --}}
  13. @php
  14. if (! empty($file['asset'])) {
  15. $file['location'] = asset($file['location']);
  16. }
  17. @endphp
  18. {{-- Check the requested file type --}}
  19. @if($file['type'] == $type && $type == 'css')
  20. <link rel="stylesheet" href="{{ $file['location'] }}">
  21. @elseif($file['type'] == $type && $type == 'js')
  22. <script src="{{ $file['location'] }}" @if(! empty($file['defer'])) defer @endif></script>
  23. @endif
  24. @endforeach
  25. @endif
  26. @endforeach