Laravel orchid make polymorphing relation

148 Views Asked by At

I have polymorphic relations

class ActionItems extends Model
{
    use HasFactory;
    use AsSource;
    use Filterable;

    public function actionable(){
        return $this->morphTo();
    }
}

And

public function actionable(){
    return $this->morphOne(Action::class,'actionable');
}

How I make form for polymorphing relations?

I find this code:

Relation::morphMap([
    'image' => Image::class,
    'post' => Post::class,
]);

https://laravel-news.com/enforcing-morph-maps-in-laravel

and is not work.

0

There are 0 best solutions below