I've an enum
field in my migration. The code is here:
Schema::create('clients', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->string('preview_img');
$table->enum('platform', ['android', 'ios']);
$table->integer('sort')->default(0)->nullable();
$table->timestamps();
});
I'm trying to insert the following data in the enum:
I've the protected $fillable = ['platform'];
in the Client
model.
But as the result I see the following:
Where is my mistake? I've tried this variant:
$platform = '';
foreach ($request->platform as $p) {
$platform .= $p . ',';
}
$platform = rtrim($platform, ',');
$client->platform = $platform;
But it does not work too.