Malja
Malja
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
Thank you nevertheless
14 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
But again, that's not ideal. For admin users, who know what are they doing, this may be fine. But I cannot expect the end-user to know, that thay have to click on the plus icon and create a new record in modal window.
14 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
Select with createOptionForm works fine.
14 replies
FFilament
Created by kenromdavids on 8/30/2023 in #❓┊help
Return value is expected to be \Filament\Tables\Table
What's your php version?
9 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
@Ashk thank you for suggestions. Both models have
protected $guarded = [];
protected $guarded = [];
I know there are multiple ways to create the relation, but I'd prefer something 'built-in' . That's why I am asking.
14 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
id of both Customer and Address are created the same way:
$table->uuid('id')->primary();
$table->uuid('id')->primary();
14 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
Of course, you are right... However even with that change, I am getting following error:
Not null violation: 7 ERROR: null value in column "address_id" of relation "customers" violates not-null constraint
Not null violation: 7 ERROR: null value in column "address_id" of relation "customers" violates not-null constraint
Does relationship work with uuids?
14 replies
FFilament
Created by Malja on 8/29/2023 in #❓┊help
Use `relationship()` when creating a new record
Without 'relationship' in the Address section, I'm able to read all address-related values in the handleRecordCreation method. In the worst-case scenario, I can save the relation manually. PS: The name of the relation matches the name of the method in the Customer model:
public function address(): HasOne {
return $this->hasOne(Address::class);
}
public function address(): HasOne {
return $this->hasOne(Address::class);
}
14 replies