-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Custom scope directive works as intended until we add our custom configuration of Blade::stringable into AppServiceProvider.
Steps to reproduce
- Install this package
- Use the example from the docs
index.blade.php
@component('components.list', ['objects' => $objects])
@scopedslot('item', ($object))
<li>
{{ $object->name }}
@if($object->isEditable)
<a href="{{ route('objects.edit', $object->id) }}">{{ __('Edit') }}</a>
@endif
</li>
@endscopedslot
@endcomponentcomponents/list.blade.php
<ul>
@foreach($objects as $object)
{{ $item($object) }}
@endforeach
</ul>- No problems so far
- Register
Blade::stringableinto yourAppServiceProviderusingbootmethod
public function boot(): void
{
Blade::stringable(function(\Illuminate\Support\Carbon $value) {
return $value->format('d. m. Y');
});
}- Run
php artisan optimize:clear - Page now no longer works and an exception is thrown.
Internal Server Error
ErrorException
Undefined variable $__bladeCompiler
I have not found any solution to this problem. Please let me know if you manage to fix it. I want to apply default formatting of dates in blade components, but it seems the custom scope directive is somehow conflicting with it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels