mirror of
https://github.com/koel/koel
synced 2024-12-23 11:03:05 +00:00
25 lines
574 B
PHP
25 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Http\Requests\API\SettingRequest;
|
|
use App\Models\Setting;
|
|
use App\Models\User;
|
|
use App\Services\MediaSyncService;
|
|
|
|
class SettingController extends Controller
|
|
{
|
|
public function __construct(private MediaSyncService $mediaSyncService)
|
|
{
|
|
}
|
|
|
|
public function update(SettingRequest $request)
|
|
{
|
|
$this->authorize('admin', User::class);
|
|
|
|
Setting::set('media_path', rtrim(trim($request->media_path), '/'));
|
|
$this->mediaSyncService->sync();
|
|
|
|
return response()->noContent();
|
|
}
|
|
}
|