Skip to content

Commit

Permalink
FEATURE ✨ Add Livewire3 support and font flexibiity (#19)
Browse files Browse the repository at this point in the history
* Update config.php

* Update admin-layout.blade.php

* Update README.md

* Update README.md
  • Loading branch information
ndeblauw authored Sep 19, 2024
1 parent d595398 commit bae777e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,26 @@ You can install the package via composer:
composer require ndeblauw/blue-admin
```

Or manually add the following line to composer.json for the legacy version:
```
"ndeblauw/blue-admin": "^1.0",
```
or for the newest version
```
"ndeblauw/blue-admin": "9999999-dev",
```


## Usage
When using vite, don't forget to add to `tailwind.config.js`the following line
```js
export default {
content: [
// Existing paths
'./vendor/ndeblauw/blue-admin/resources/**/*.blade.php', // <-- ADD THIS
],
```
When using the Tinymceimage component, don't forget to add `blueadmin/tinymce/upload` to the $except list in the `\App\Http\Middleware\VerifyCsrfToken.php` middleware to make sure the image uploads will happen.
Expand Down
6 changes: 6 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
'fontawesomekit_url' => 'https://kit.fontawesome.com/0bde3bbac3.js',

'vite' => false,
'livewire_v3' => false,

'font' => [
'include' => 'https://fonts.bunny.net/css?family=sofia-sans',
'family' => 'Sofia Sans',
],

'filepond_temporary_files_disk' => 'local',
'filepond_temporary_files_path' => 'filepond',
Expand Down
17 changes: 13 additions & 4 deletions resources/views/components/adminlayout/admin-layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=nunito:400,500,600,700" rel="stylesheet" />
<link href="{{config('blue-admin.font.include', 'https://fonts.bunny.net/css?family=nunito')}}" rel="stylesheet" />
<script src="https://kit.fontawesome.com/2d1659a0a3.js" crossorigin="anonymous"></script>

<!-- Styles & scripts -->
Expand All @@ -20,7 +20,11 @@
<script src="{{ mix('js/app.js') }}" defer></script>
@endif

@livewireStyles
@if(config('blue-admin.livewire_v3', false))
<!-- nothing -->
@else
@livewireStyles
@endif

<style>
[x-cloak] {
Expand All @@ -38,7 +42,7 @@

@stack('blueadmin_header')
</head>
<body class="font-sans antialiased h-full">
<body class="font-sans antialiased h-full" style="font-family: '{{config('blue-admin.font.family', 'Nunito')}}'">
@if (Session::has('loginas') )
<div class="border-b border-lime-400 bg-lime-100 py-4 text-center text-black">
<i class="fa fa-exclamation-triangle text-lime-400"></i>&nbsp;
Expand Down Expand Up @@ -77,7 +81,12 @@
</div>
</div>

@livewireScripts
@if(config('blue-admin.livewire_v3', false))
@livewireScripts {{-- Always include to have AlpineJs --}}
@else
@livewireScripts
@endif

@stack('blueadmin_scripts')
</body>
</html>

0 comments on commit bae777e

Please sign in to comment.