Remove blade component dependency

This commit is contained in:
Ryan Scherler
2020-12-15 15:03:55 -08:00
parent 1c9d7c3ad1
commit fab9a3501b
7 changed files with 18 additions and 8 deletions
-1
View File
@@ -8,7 +8,6 @@
],
"license": "MIT",
"require": {
"appstract/laravel-blade-directives": "^1.10",
"blade-ui-kit/blade-heroicons": "^0.3",
"graham-campbell/markdown": "^13.1",
"league/glide-laravel": "^1.0",
@@ -2,7 +2,6 @@
<x-filament::label>
<span class="inline-flex items-center space-x-2">
<input type="{{ $type }}"
name="{{ $name }}"
@if ($model)
{{ $modelDirective }}="{{ $model }}"
@endif
-1
View File
@@ -2,7 +2,6 @@
@section('field')
<input type="{{ $type }}"
name="{{ $name }}"
id="{{ $id ?? $name }}"
value="{{ $value ?? '' }}"
@if ($model)
@@ -2,7 +2,6 @@
@section('field')
<textarea
name="{{ $name }}"
id="{{ $id ?? $name }}"
@if ($model)
{{ $modelDirective }}="{{ $model }}"
+4 -4
View File
@@ -1,11 +1,11 @@
@extends('filament::layouts.field-group')
@pushonce('head:trix')
@style('https://www.unpkg.com/trix@1.3.1/dist/trix.css')
@pushonce('head')
<link rel="stylesheet" href="https://www.unpkg.com/trix@1.3.1/dist/trix.css">
@endpushonce
@pushonce('js:trix')
@script('https://www.unpkg.com/trix@1.3.1/dist/trix.js')
@pushonce('js')
<script src="https://www.unpkg.com/trix@1.3.1/dist/trix.js"></script>
@endpushonce
@section('field')
+12
View File
@@ -13,4 +13,16 @@ class BladeDirectives
{
return '{!! \Filament::scripts() !!}';
}
public static function pushOnce($expression): string
{
$var = '$__env->{"__pushonce_" . md5(__FILE__ . ":" . __LINE__)}';
return "<?php if(!isset({$var})): {$var} = true; \$__env->startPush({$expression}); ?>";
}
public static function endPushOnce(): string
{
return '<?php $__env->stopPush(); endif; ?>';
}
}
+2
View File
@@ -90,6 +90,8 @@ class FilamentServiceProvider extends ServiceProvider
{
Blade::directive('filamentStyles', [BladeDirectives::class, 'styles']);
Blade::directive('filamentScripts', [BladeDirectives::class, 'scripts']);
Blade::directive('pushonce', [BladeDirectives::class, 'pushOnce']);
Blade::directive('endpushonce', [BladeDirectives::class, 'endPushOnce']);
}
protected function bootPublishing(): void