Answer the question
In order to leave comments, you need to log in
Where and how can I send a bug?
I think I found a bug (I'll be glad if I'm just doing something wrong and you tell me), how to report it or at least discuss it with people close to the Laravel team?
The mutator does not want to convert fields with numbers:
Schema::create('tests', function (Blueprint $table) {
$table->increments('id');
$table->string('field_100');
$table->string('field_200');
$table->timestamps();
});
class Test extends Model
{
public function getField100Attribute($value) {
return 'qweqwewq';
}
public function getField200Attribute($value) {
return 'qweqweqweqweqw';
}
}
[
{
"id": 1,
"field_100": "123",
"field_200": "123",
"created_at": null,
"updated_at": null
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question