StringKe
StringKe
Explore posts from servers
FFilament
Created by StringKe on 2/8/2025 in #❓┊help
How to replace pre-compiled tailwind css file?
I will share all tailwindcss configurations within the application. Currently some extra css in the filament panel doesn't work properly. My vite css registered through renderhook is not overriding the styles correctly. Just like .grid gets defined many times.
8 replies
FFilament
Created by StringKe on 7/3/2024 in #❓┊help
Images uploaded without the FileUpload component cannot be displayed.
No description
16 replies
FFilament
Created by StringKe on 7/2/2024 in #❓┊help
How to dynamically control the configuration of other components in a form?
I need to change another option for selecting components I tried to write it but it doesn't work. Is there any way to achieve this behavior? Also attribute_ids changes I may change another component multilevel dependencies will be updated? For example, a <- b <- c, when c is modified, b needs to be modified at the same time, and a can only be modified when b is done.
Forms\Components\Select::make('attribute_parent_ids')
->label('属性父级')
->options(ProductAttribute::whereNull('parent_id')
->pluck('title', 'id'))
->multiple()
->live(true)
->afterStateUpdated(function (
Forms\Components\Select $component
) {

/** @var Forms\Components\Select $select */
$select = $component->getContainer()
->getComponent('valueIds');

$options = ProductAttribute::whereNotNull('parent_id')
->whereIn('parent_id',
$component->getState())
->pluck('title',
'id');

// remove is cancel options
$newState =
collect($select->getState())
->filter(function ($value) use (
$options
) {
return isset($options[$value]);
})
->toArray();

$select->state($newState)
->options($options);
})
->nullable(),
Forms\Components\Select::make('attribute_ids')
->label('属性')
->options([])
->multiple()
->live(true)
->nullable()
->key('valueIds')
Forms\Components\Select::make('attribute_parent_ids')
->label('属性父级')
->options(ProductAttribute::whereNull('parent_id')
->pluck('title', 'id'))
->multiple()
->live(true)
->afterStateUpdated(function (
Forms\Components\Select $component
) {

/** @var Forms\Components\Select $select */
$select = $component->getContainer()
->getComponent('valueIds');

$options = ProductAttribute::whereNotNull('parent_id')
->whereIn('parent_id',
$component->getState())
->pluck('title',
'id');

// remove is cancel options
$newState =
collect($select->getState())
->filter(function ($value) use (
$options
) {
return isset($options[$value]);
})
->toArray();

$select->state($newState)
->options($options);
})
->nullable(),
Forms\Components\Select::make('attribute_ids')
->label('属性')
->options([])
->multiple()
->live(true)
->nullable()
->key('valueIds')
2 replies
FFilament
Created by StringKe on 8/19/2023 in #❓┊help
How do I submit a form automatically?
I'm implementing a function to bind tenants. 1. I want to execute the bind function directly when the url contains /bind?code=abc 2. render a page for the user to enter the code when it doesn't exist. What should I do? I tried to do this, but I don't know how the form should be submitted automatically.
TextInput::make('code')
->label('Code')
->required()
->helperText(
'Please enter the code provided by your company. If you do not have a code, contact your company administrator.'
)
->default(function (Set $set, Request $request) {
if ($request->has('code')) {
return $request->get('code');
}
return null;
}),
TextInput::make('code')
->label('Code')
->required()
->helperText(
'Please enter the code provided by your company. If you do not have a code, contact your company administrator.'
)
->default(function (Set $set, Request $request) {
if ($request->has('code')) {
return $request->get('code');
}
return null;
}),
2 replies
FFilament
Created by StringKe on 8/16/2023 in #❓┊help
How do I add a route that skips the tenant prefix?
2 replies
TtRPC
Created by StringKe on 6/4/2023 in #❓-help
How does trpc subscription actively close/disconnect in the server?
How do I actively disconnect my subscription?
11 replies
TtRPC
Created by StringKe on 3/31/2023 in #❓-help
The type of the second route of the nested route is never
3 replies
TtRPC
Created by StringKe on 1/9/2023 in #❓-help
How are they defined separately?
41 replies
TtRPC
Created by StringKe on 11/10/2022 in #❓-help
Request or Response Specification Definition Document
I am developing a backend service using trpc, but I need to dispatch trpc in another programming language. I would like to know the design specification of trpc related requests and responses so that I can implement it in other languages.
2 replies