KinBH
KinBH
FFilament
Created by KinBH on 5/15/2024 in #❓┊help
Salve multiple relation
I was able to figure out the problem. It was necessary to make the fields nullable because Filament saves null first and then updates, so it was generating the error. With this problem solved, now I have another lol. When I use MULTIPLE os athlets, POST form comes as an array: update teams set athlete_id = ["2","1"], teams.updated_at = 2024-05-17 14:14:31 where id = 6 ... However, the field is a bigInt due to the relationship. How do I make Filament save this array line by line? competicoe_id | atlhet_id
13 replies
FFilament
Created by KinBH on 5/15/2024 in #❓┊help
Salve multiple relation
nothing change after change hasMany. QLSTATE[HY000]: General error: 1364 Field 'atleta_id' doesn't have a default value: INSERT INTO equipes (competicoe_id, updated_at, created_at) VALUES....
"atleta_id" not show on query
13 replies
FFilament
Created by KinBH on 5/15/2024 in #❓┊help
Salve multiple relation
13 replies
FFilament
Created by KinBH on 5/15/2024 in #❓┊help
Salve multiple relation
if a remove mutiple, its oks, but with multiple give error
13 replies
FFilament
Created by KinBH on 5/15/2024 in #❓┊help
Salve multiple relation
yes, both: <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Equipes extends Model { use HasFactory; use SoftDeletes; protected $guarded = []; protected $fillable = ['atleta_id', 'competicoe_id']; protected $dates = ['created_at', 'updated_at', 'deleted_at']; public function atletas() { return $this->belongsTo(Atleta::class, 'atleta_id'); } public function competicoes() { return $this->belongsTo(Competicoe::class, 'competicoe_id'); } }
13 replies
FFilament
Created by KinBH on 4/22/2024 in #❓┊help
Points with decimal
How to use on form, to update when is typing?
6 replies
FFilament
Created by KinBH on 1/5/2024 in #❓┊help
How to get return from model to $form
I use for id, but how to implement for my case? protected function mutateFormDataBeforeCreate(array $data): array { $data['user_id'] = auth()->id(); return $data; }
5 replies