feat(settings): add menu/show_to_user and public get_settings for client apps

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 15:32:35 +03:30
co-authored by Cursor
parent 5c542e2733
commit b28a98938e
9 changed files with 321 additions and 44 deletions
@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
if (! Schema::hasTable('settings')) {
return;
}
Schema::table('settings', function (Blueprint $table) {
if (! Schema::hasColumn('settings', 'menu')) {
$table->string('menu', 64)->nullable()->after('can_edit');
}
if (! Schema::hasColumn('settings', 'show_to_user')) {
$table->boolean('show_to_user')->default(false)->after('menu');
}
});
$path = database_path('sql/settings_menu_and_show_to_user.sql');
if (is_file($path)) {
DB::unprepared((string) file_get_contents($path));
}
}
public function down(): void
{
if (! Schema::hasTable('settings')) {
return;
}
Schema::table('settings', function (Blueprint $table) {
if (Schema::hasColumn('settings', 'show_to_user')) {
$table->dropColumn('show_to_user');
}
if (Schema::hasColumn('settings', 'menu')) {
$table->dropColumn('menu');
}
});
}
};