pboivin
12/22/2021, 1:15 PMblocks property of field but I don't think this can be done dynamically like @formConnectedFields. Also, changing the available blocks won't affect the existing blocks, like remove previous blocks that are no longer "valid" in the current available blocks.Sebastianpusch
12/22/2021, 1:16 PMifox
12/22/2021, 1:19 PMrelated browser feature to make this kind of relationship. you need regular browsers that save a belongsTo.ifox
12/22/2021, 1:21 PM$browsers instead hereifox
12/22/2021, 1:23 PMtutorumdev
12/22/2021, 1:29 PMSebastianpusch
12/22/2021, 1:29 PMSebastianpusch
12/22/2021, 1:40 PMifox
12/22/2021, 1:47 PMtutorumdev
12/22/2021, 1:47 PMtutorumdev
12/22/2021, 1:48 PMifox
12/22/2021, 1:48 PMApp\Models\Journeyifox
12/22/2021, 1:48 PMApp\Journeyifox
12/22/2021, 1:50 PMclient and same in the repository's $browsers arrayifox
12/22/2021, 1:51 PMApp\Models\Client not App\Client tooifox
12/22/2021, 1:55 PMtutorumdev
12/22/2021, 1:59 PMprotected $browsers = ['client','category'];
public function __construct(Journey $model)
{
$this->model = $model;
}
public function afterSave($object, $fields)
{
$this->updateBrowser($object, $fields, 'client');
$this->updateBrowser($object, $fields, 'category');
parent::afterSave($object, $fields);
}
public function getFormFields($object)
{
$fields = parent::getFormFields($object);
$fields['browsers']['client'] = $this->getFormFieldsForBrowser($object, 'client');
$fields['browsers']['category'] = $this->getFormFieldsForBrowser($object, 'category');
return $fields;
} is everything here correctly changed up?Sebastianpusch
12/22/2021, 2:02 PMifox
12/22/2021, 2:02 PM$browsers arraytutorumdev
12/22/2021, 2:02 PMifox
12/22/2021, 2:03 PMtutorumdev
12/22/2021, 2:07 PM@formField('browser', [
'moduleName' => 'clients',
'name' => 'client_id',
'label' => 'Clients',
'max' => 1,
]) would the name now be client_id or still client? at the end of the day the idea is to save into a database column known as client_idtutorumdev
12/22/2021, 2:09 PMtutorumdev
12/22/2021, 2:10 PMifox
12/22/2021, 2:21 PMifox
12/22/2021, 2:22 PMtutorumdev
12/22/2021, 2:23 PMifox
12/22/2021, 2:24 PMtutorumdev
12/22/2021, 3:03 PMtutorumdev
12/22/2021, 4:12 PM