set filament brand config to site name setting (#297)

This commit is contained in:
Alex Justesen
2023-01-05 16:36:26 -05:00
committed by GitHub
parent 2492dde0b0
commit 1e093aa4eb
2 changed files with 7 additions and 39 deletions
@@ -3,6 +3,7 @@
namespace App\Providers;
use App\Models\User;
use App\Settings\GeneralSettings;
use Filament\Facades\Filament;
use Filament\Navigation\NavigationItem;
use FilamentVersions\Facades\FilamentVersions;
@@ -32,6 +33,12 @@ class FilamentServiceProvider extends ServiceProvider
return true;
});
try {
config(['filament.brand' => app(GeneralSettings::class)->site_name ?? env('APP_NAME')]);
} catch (\Throwable $th) {
// if this fails it's because the migration doesn't exist so it can be skipped
}
FilamentVersions::addItem('Speedtest Tracker', 'v'.config('speedtest.build_version'));
Filament::serving(function () {
@@ -1,39 +0,0 @@
<?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('cache', function (Blueprint $table) {
$table->string('key')->primary();
$table->mediumText('value');
$table->integer('expiration');
});
Schema::create('cache_locks', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('owner');
$table->integer('expiration');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cache');
Schema::dropIfExists('cache_locks');
}
};