jewishmoses
2 weeks ago
145
5
Laravel

How to use casts with json columns?

Posted 2 weeks ago by jewishmoses

I tried the following:

public $casts = [
    'slug->en' => Slug::class,
];

I didn't get any error, but it didn't set the slug as it should.

Model::create(['slug->en' => 'Title'])

Please sign in or create an account to participate in this conversation.