Home > database >  Cutted string when get value of field
Cutted string when get value of field

Time:05-22

Anyone can explain why when access to field only return part of string?

unexplicable problem when get value of field

CodePudding user response:

Can you check your CursSM model file, there may be a attribute casting, which override the result. Check the additional information in laravel documentation - https://laravel.com/docs/9.x/eloquent-mutators

CodePudding user response:

I can't understand!

Model was:

class cursSM extends Model
{
    use HasFactory;

    protected $table = 'curs_sm';
    protected $primaryKey = 'curs';

    public $timestamps = false;
}

changed to

class cursSM extends Model
{
    use HasFactory;

    protected $table = 'curs_sm';
}

now works fine!

  • Related