jay02k
Change admin panel logo with spatie-setting package
this is my new controller
<?php
namespace App\Http\Controllers;
use App\Settings\AdminSettings;
use Illuminate\Http\Request;
class SettingsController extends Controller
{
public function show(AdminSettings $settings){
return view('welcome', [
'site_name' => $settings->site_name
]);
}
}
41 replies
Change admin panel logo with spatie-setting package
<?php
namespace App\Settings;
use Spatie\LaravelSettings\Settings;
class AdminSettings extends Settings
{
public string $site_name;
public bool $site_active;
public string $site_copyright;
public string $site_logo;
public string $site_favicon;
public static function group(): string
{
return 'admin';
}
}
41 replies
Change admin panel logo with spatie-setting package
i got this error even i already use the controller from docs
Error: Undefined variable $site_name
class GeneralSettingsController
{
public function show(GeneralSettings $settings){
return view('settings.show', [
'site_name' => $settings->site_name,
'site_active' => $settings->site_active
]); } I even try this controller class IndexController { public function __invoke(GeneralSettings $settings){ return view('index', [ 'site_name' => $settings->site_name, ]); } }
]); } I even try this controller class IndexController { public function __invoke(GeneralSettings $settings){ return view('index', [ 'site_name' => $settings->site_name, ]); } }
41 replies