KM Nurunnabi
KM Nurunnabi
FFilament
Created by KM Nurunnabi on 9/28/2024 in #❓┊help
Disabling action realtime on state change
hey there. I have a custom action in edit resource page given below
Actions\Action::make('someAction')
->action(function () {
})
->disabled(fn(?Model $record) => $record->isDirty())
->outlined()
->hidden(fn(?Model $record) => $record?->trashed()),
Actions\Action::make('someAction')
->action(function () {
})
->disabled(fn(?Model $record) => $record->isDirty())
->outlined()
->hidden(fn(?Model $record) => $record?->trashed()),
What i want, whenever record get dirty I want to disable it. But following code is not reflecting in realtime on state change. what can I do here?
5 replies
FFilament
Created by KM Nurunnabi on 7/6/2024 in #❓┊help
Getting Null for Multi-Select in Custom Page
I have created a custom page where I have form inputs:
public function form(Form $form): Form
{
return $form
->schema([
Section::make('Push a Notification to Firebase')
->schema([
Forms\Components\Select::make('topics')
->multiple()
->options(FcmTopic::class),
Forms\Components\TextInput::make('title')->required(),
Forms\Components\Textarea::make('message')->required(),
Forms\Components\TextInput::make('image_url')->required(),
Forms\Components\TextInput::make('content_url')->required(),
]),
])
->statePath('data');
}
public function form(Form $form): Form
{
return $form
->schema([
Section::make('Push a Notification to Firebase')
->schema([
Forms\Components\Select::make('topics')
->multiple()
->options(FcmTopic::class),
Forms\Components\TextInput::make('title')->required(),
Forms\Components\Textarea::make('message')->required(),
Forms\Components\TextInput::make('image_url')->required(),
Forms\Components\TextInput::make('content_url')->required(),
]),
])
->statePath('data');
}
I don't need any model to store these values. and when I submit, I get all the values except multiple select and it's always return null. But without ->multiple() it works fine. What is the issue here?
3 replies
FFilament
Created by KM Nurunnabi on 5/3/2024 in #❓┊help
Json Exporter
I don’t know if filament provide a json exporter by default. If not then is there any way to make a custom json action?
2 replies
FFilament
Created by KM Nurunnabi on 3/29/2024 in #❓┊help
To Change table column link
As I know edit link is default to each table column when clicking. But I wanna change that into index link. How to?
3 replies
FFilament
Created by KM Nurunnabi on 2/11/2024 in #❓┊help
Want to achieve Livewire form dynamically
Hey. I have a livewire component with few forms is given below: <?php namespace App\Livewire\User\Quizzes; use App\Livewire\Forms\User\AnswerForm; use App\Livewire\Forms\User\OptionForm; use App\Livewire\Forms\User\QuestionForm; use App\Livewire\Forms\User\QuizForm; use App\Models\Quiz; use Livewire\Component; class CreateQuiz extends Component { public QuizForm $quizForm; public QuestionForm $questionForm; public function save() { dd($this->questionForm->all()); $this->validate(); Quiz::create($this->quizForm->all()); } public function render() { return view('livewire.user.quizzes.create-quiz'); } } But question is, quiz can have mutiple questions. That mean I need a collection of QuestionForm class. But I don't know how can I acquired that. Does anybody knows how to take an array of QuestionForm class? Then how can I validate array of Form?
3 replies
FFilament
Created by KM Nurunnabi on 1/7/2024 in #❓┊help
Can filament Form be exposed publicly?
I had a question. Suppose I want public to register our application. If I create a register form using filament, will I be abled to expose this register form to public?
1 replies