Itachi
Itachi
FFilament
Created by Itachi on 1/9/2024 in #❓┊help
how modify list page data
i just want to show admin realated data.
4 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
thank you,everyone👍
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
Sir, I just want to modify that on a specific page, not on every page.
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
No description
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
Sir, I have not created any action buttons. Filament provides default buttons such as 'Create,' 'Create and Create Another,' and 'Cancel' on the create page. I would like to rename the 'Create' button to 'Save.'
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
it show Method Filament\Forms\Form::label does not exist. this error
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
sir in resources file create button
19 replies
FFilament
Created by Itachi on 12/18/2023 in #❓┊help
How modify create button label
public static function createButtonLabel() { return 'YourButtonTextHere'; } this function didnot work
19 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
Thank you sir it works
14 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
ok sir
14 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
no sir,it is not working
14 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
protected function getHeaderActions(): array
{
$formFilled=false;
if($this->data['difficulty_level'] && $this->data['type']){$formFilled= true;
}
return [
Actions\CreateAction::make()
->label('Generate')
->action(fn() => $this->fillFormFields())
->hidden(!$formFilled)
->color($formFilled ? 'success':'danger'),
];
}
protected function fillFormFields()
{
//dd("hii");
$lesson = \App\Models\Lesson::findOrFail($this->data['lesson_id']);
$topic = \App\Models\Topic::find($lesson->topic_id);
$difficulty_level = $this->data['difficulty_level'];
$type = $this->data['type'];
$material = new \App\Models\Material;
$content = json_decode($material->generateContent($topic->title, $lesson->title, $difficulty_level, $type));
if ($this->data['type'] == 'video') {if ($content->view_link) {
$videoId = explode('?v=', $content->view_link)[1];
}}
$data['type'] = $this->data['type'];
$data['difficulty_level'] = $difficulty_level;
$data['lesson_id'] = $this->data['lesson_id'];
$data['embeded_link'] = $content->link;
$data['title'] = $content->title;
$data['duration'] = $content->duration;
if ($this->data['type'] == 'video') {
$data['captions'] = $material->generateCaption($videoId);
}
if ($this->data['type'] == 'text') {
$data['Text'] = $content->Text;
$data['Description'] = $content->Description;
}
if ($this->data['type'] == 'html') {
$data['Html'] = $content->Html;
}
$this->form->fill($data);
}
protected function getHeaderActions(): array
{
$formFilled=false;
if($this->data['difficulty_level'] && $this->data['type']){$formFilled= true;
}
return [
Actions\CreateAction::make()
->label('Generate')
->action(fn() => $this->fillFormFields())
->hidden(!$formFilled)
->color($formFilled ? 'success':'danger'),
];
}
protected function fillFormFields()
{
//dd("hii");
$lesson = \App\Models\Lesson::findOrFail($this->data['lesson_id']);
$topic = \App\Models\Topic::find($lesson->topic_id);
$difficulty_level = $this->data['difficulty_level'];
$type = $this->data['type'];
$material = new \App\Models\Material;
$content = json_decode($material->generateContent($topic->title, $lesson->title, $difficulty_level, $type));
if ($this->data['type'] == 'video') {if ($content->view_link) {
$videoId = explode('?v=', $content->view_link)[1];
}}
$data['type'] = $this->data['type'];
$data['difficulty_level'] = $difficulty_level;
$data['lesson_id'] = $this->data['lesson_id'];
$data['embeded_link'] = $content->link;
$data['title'] = $content->title;
$data['duration'] = $content->duration;
if ($this->data['type'] == 'video') {
$data['captions'] = $material->generateCaption($videoId);
}
if ($this->data['type'] == 'text') {
$data['Text'] = $content->Text;
$data['Description'] = $content->Description;
}
if ($this->data['type'] == 'html') {
$data['Html'] = $content->Html;
}
$this->form->fill($data);
}
14 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
yes sir i alredy try that .but it donot enter in filleformfields function.
14 replies
FFilament
Created by Itachi on 11/13/2023 in #❓┊help
how to call a custom function within the action method
yes sir it is custom
14 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
Why in v3 action method donot call another function
i write this in create page i have created their a button when i click on that button it should call fillFormFields() function ,for this functionlity i write this code
->action(fn () => $this->fillFormFields())
->action(fn () => $this->fillFormFields())
but it donot call fillFormFields() function you have any other way
13 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
->reactive() method doesnot work on v3
thank you sir
6 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
Why in v3 action method donot call another function
public function getActions(): array
{
$formFilled = empty($this->data['lesson_id']) || empty($this->data['difficulty_level']);
return [
Actions\CreateAction::make()
->label('Generate from ChatGPT')
->action(fn () => $this->fillFormFields())
->disabled($formFilled)
->color($formFilled ? 'secondary' : 'success')
->outlined()
->extraAttributes(['class' => 'abc', 'style' => 'float:right']),
];
}
public function getActions(): array
{
$formFilled = empty($this->data['lesson_id']) || empty($this->data['difficulty_level']);
return [
Actions\CreateAction::make()
->label('Generate from ChatGPT')
->action(fn () => $this->fillFormFields())
->disabled($formFilled)
->color($formFilled ? 'secondary' : 'success')
->outlined()
->extraAttributes(['class' => 'abc', 'style' => 'float:right']),
];
}
this function is already work on v2 but not work in v3 so tell me what modify i do
13 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
Why in v3 action method donot call another function
sir i try to call fillformfields function when i click on generate function
13 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
Why in v3 action method donot call another function
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->label('Generate')
->action(fn () => $this->fillFormFields()),


];
}
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make()
->label('Generate')
->action(fn () => $this->fillFormFields()),


];
}
13 replies
FFilament
Created by Itachi on 11/9/2023 in #❓┊help
Why in v3 action method donot call another function
nosir it is not a modal
13 replies