Note: This issue only occurs for Voyager's tables.
Versions
Laravel version
9.39.0
PHP version
8.1.7
Voyager version
1.6
Database
MYSQL 8.0
Description
Locale column doesn't show any data on the browse page
Even though the Locale column appears on the edit page
Steps to reproduce
1. Create Locale migration
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('locales', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('short_name');
$table->string('name');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('locales');
}
};
2. Create a migration to update the menu table
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('menus', function (Blueprint $table) {
$table->foreignId('locale_id')->nullable()->constrained()->nullOnDelete();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('menus', function (Blueprint $table) {
$table->dropForeign('locale_id');
});
}
};
3. Setup Locale's bread
4. Setup Relation field on Menu's bread
5. Add some locales data
6. Edit a menu data and connect the locale created before
Expected behavior
Menu's browse page shows the relation column properly.
Note: This issue only occurs for Voyager's tables.
Versions
Laravel version
9.39.0
PHP version
8.1.7
Voyager version
1.6
Database
MYSQL 8.0
Description
Locale column doesn't show any data on the browse page
Even though the Locale column appears on the edit page
Steps to reproduce
1. Create Locale migration
2. Create a migration to update the
menu
table3. Setup Locale's bread
4. Setup Relation field on Menu's bread
5. Add some locales data
6. Edit a menu data and connect the locale created before
Expected behavior
Menu's browse page shows the relation column properly.
Additional Context
Locale roles
Relation details on Menu's bread page
Menu table
Locale table