Algorithm
aftersave() hook method triggered three times when I edit a record.
protected function afterSave()
{
Log::info('testing');
}
this is the log:
[2024-01-30 09:37:13] local.INFO: testing[2024-01-30 09:37:13] local.INFO: testing
[2024-01-30 09:37:13] local.INFO: testing
1 replies
FileUpload doesn't accept MorphTo.
This is the product model:
public function photo(): MorphOne
{
return $this->morphOne(Photo::class, 'photoable');
}
This is the photo model:
public function photoable(): MorphTo
{
return $this->morphTo();
}
This is the resource:
FileUpload::make('photo')
->image()
->placeholder(__('Photo')),
When I upload then the photo table is empty.5 replies
Change the language of Select Component
I have a form and that form has a Select component that has relationship with department table.
The problem that I faced is that when I change the language in create then select data stays in the same language and doesn't change.
I use Spatie/Translatable plugin.
The component with relationship is:
Department Model:
CreateJob.php
Thank you.
11 replies