Leonel López
After form submission, data insertion is blocked due to an array issue related to marked checkboxes
Yes I added this cast
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Membership extends Model
{
use HasFactory;
protected $casts = [
'videos' => 'array',
];
protected $fillable = ['user_id', 'video_id', 'abonnement_id', 'status'];
public function users(): BelongsTo
{
return $this->BelongsTo(User::class);
} public function abonnements(): BelongsTo { return $this->BelongsTo(Abonnement::class);
} } And still 'Array to string conversion' error
} public function abonnements(): BelongsTo { return $this->BelongsTo(Abonnement::class);
} } And still 'Array to string conversion' error
7 replies