Как получить значение поиска из переведенной таблицы в laravel?

У меня есть таблица действий с идентификатором в ней и переведенная таблица действий, где все переведенные даты хранятся вместе с Activity_id.

Я хочу быть красноречивым из этих отношений, где название деятельности дается язык
ниже моя миграция

 Schema::create('activity_types', function (Blueprint $table) {
$table->increments('id');
$table->boolean('flag');
$table->timestamps();
});
Schema::create('activity_type_translations', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('slug');
$table->string('description');
$table->integer('activity_type_id')->unsigned();
$table->string('locale')->index();
$table->timestamps();
$table->unique(['activity_type_id','locale']);
$table->foreign('activity_type_id')->references('id')->on('activity_types')->onDelete('cascade');
});
Schema::create('activities', function (Blueprint $table) {
$table->increments('id');
$table->string('code');
$table->integer('country_id')->unsigned();
$table->integer('activity_type_id')->unsigned();
$table->integer('region_id')->unsigned();
$table->string('feature_image');
$table->string('route_map')->nullable();
$table->boolean('flag');
$table->timestamps();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->foreign('activity_type_id')->references('id')->on('activity_types')->onDelete('cascade');
$table->foreign('region_id')->references('id')->on('regions')->onDelete('cascade');
});
Schema::create('activity_translations', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('duration');
$table->string('trek_duration');
$table->string('trek_grade');
$table->string('accomodation');
$table->string('meal');
$table->string('max_altitude');
$table->string('best_time');
$table->string('max_group_size');
$table->string('individual_cost');
$table->string('group_cost');
$table->text('summary');
$table->text('overview');
$table->text('itinenary');
$table->text('important_note');
$table->text('cost_include');
$table->text('cost_exclude');
$table->text('equipment_checklist');
$table->text('before_you_go');
$table->enum('trip_status', ['booking open', 'join a group']);
$table->integer('activity_id')->unsigned();
$table->string('locale')->index();
$table->timestamps();
$table->unique(['activity_id','locale']);
$table->foreign('activity_id')->references('id')->on('activities')->onDelete('cascade');
});

Я хочу найти действия с другим языком и другим регионом и другими параметрами и вернуться в красноречивый

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector