uwascan
10/18/2022, 8:25 PM@formField('checkbox', [
'name' => 'vertical_article',
'label' => 'Vertical Story'
])
@formConnectedFields([
'fieldName' => 'vertical_article',
'fieldValues' => true,
'renderForBlocks' => true,
])
@formField('medias', [
'name' => 'vertical_image',
'label' => 'Vertical Image',
])
@endformConnectedFields
now I have a blank page. Not a single field is showing.ifox
10/18/2022, 8:25 PMifox
10/18/2022, 8:26 PMrenderForBlocks
uwascan
10/18/2022, 8:29 PMuwascan
10/18/2022, 11:22 PMprotected $indexOptions = [
'edit' => false,
'delete' => false,
'create' => false,
'publish' => false,
'reorder' => false,
'permalink' => false,
'bulkPublish' => false,
'skipCreateModal' => false,
];
The records show up but I cant click to view the details in a readonly form. So how to I create a readonly view for module record like the I just described? Is it possible to link each record to a custom page or modal for display?ifox
10/18/2022, 11:26 PMuwascan
10/18/2022, 11:32 PMifox
10/18/2022, 11:33 PMBA7YA
10/19/2022, 10:01 AMkalle
10/19/2022, 1:01 PMdedli
10/19/2022, 1:03 PMpublic function handle()
{
$client = new Client(config('scout.meilisearch.host'), config('scout.meilisearch.key'));
$model = 'App\Models\Product';
foreach (LaravelLocalization::getSupportedLocales() as $localeCode => $properties){
app()->setLocale($localeCode);
$this->call('scout:import', [
'model' => $model
]);
$client->index(app($model)->searchableAs())->updateSearchableAttributes([
'title'
]);
$this->info('Updated searchable attributes...');
$client->index(app($model)->searchableAs())->updateFilterableAttributes([
'lang', 'category_id', 'filter_values'
]);
$this->info('Updated filterable attributes...');
}
app()->setLocale(config('twill.locale'));
}
dedli
10/19/2022, 1:03 PMpublic function toSearchableArray()
{
return [
'primary_id' => $this->id,
'title' => $this->translate(app()->getLocale())->title,
'slug' => $this->slug,
'lang' => app()->getLocale(),
'lang_id' => $this->translate(app()->getLocale())->id,
'characteristics' => $this->characteristicValues()->get()->map(function ($value){
return ['characteristic'=>$value->getRelated('characteristics')[0]->title, 'characteristic_value'=>$value->title];
})->toArray(),
'filter_values' => $this->getRelated('filterValues')->map(function ($item){
return ['filter'=>$item->filter->slug, 'filter_value'=>$item->slug];
})->toArray()
];
}
In my repository I have function
public function afterSave($object, $fields)
{
$this->updateRepeater($object, $fields, 'characteristicValues', 'CharacteristicValue', 'characteristic_values');
parent::afterSave($object, $fields);
foreach (LaravelLocalization::getSupportedLocales() as $localeCode => $properties) {
LaravelLocalization::setLocale($localeCode);
$client = new Client(config('scout.meilisearch.host'), config('scout.meilisearch.key'));
$client->updateIndex(app('\\' . get_class($this->model))->searchableAs(), ['primaryKey' => 'lang_id']);
}
LaravelLocalization::setLocale(config('twill.locale'));
app()->setLocale(config('twill.locale'));
}
My problem: I should update all languages indexes after save. I try to change locale and do it, but it update only main language. Is any idea how can I do it? I think independent on I use setLocale method my model still works only with main language (отредактировано)BA7YA
10/19/2022, 1:16 PM@formField('repeater', [
'type' => 'test_repeater',
'max' => 2
])
ifox
10/19/2022, 2:17 PMifox
10/19/2022, 2:18 PMifox
10/19/2022, 2:18 PMifox
10/19/2022, 2:19 PMdedli
10/19/2022, 2:28 PMckmirafss
10/19/2022, 10:29 PMifox
10/19/2022, 10:57 PMunique
validation rule to r`ulesForCreate` on your module's form request classifox
10/19/2022, 10:59 PMifox
10/19/2022, 10:59 PMPabMai
10/20/2022, 12:58 PMifox
10/20/2022, 1:03 PMdakaalim
10/20/2022, 10:21 PMdakaalim
10/20/2022, 10:44 PMckmirafss
10/20/2022, 10:48 PMifox
10/20/2022, 10:56 PMifox
10/20/2022, 10:58 PMdakaalim
10/20/2022, 11:40 PM