Skip to content

Can this package be used with a single polymorphic model? #152

@MordiSacks

Description

@MordiSacks

Instead of having
posts, posts_translations,
articles, articles_translations,
etc..
can I have
articles, posts,

and translations, something like this

        Schema::create('translations', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("translatable_type");
            $table->unsignedBigInteger("translatable_id");
            $table->string('column', 70);
            $table->string('locale', 5);
            $table->text('value');
            $table->timestamps();
            $table->unique([
                'translatable_type',
                'translatable_id',
                'column',
                'locale',
            ], 'translations_u_type_id_column_locale');
        });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions