mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Remove blade component dependency
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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; ?>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user