-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Install Spatie-settings * Settings wip * feat: Settings
- Loading branch information
Showing
13 changed files
with
543 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Settings\GeneralSettings; | ||
use Illuminate\Http\Request; | ||
use Inertia\Inertia; | ||
|
||
class SettingsController extends Controller | ||
{ | ||
public function index(GeneralSettings $settings) | ||
{ | ||
return response()->json($settings); | ||
} | ||
|
||
public function store(Request $request, GeneralSettings $settings) | ||
{ | ||
foreach ($request->all() as $key => $value) { | ||
$settings->$key = $value; | ||
} | ||
$settings->save(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace App\Settings; | ||
|
||
use Spatie\LaravelSettings\Settings; | ||
|
||
class GeneralSettings extends Settings | ||
{ | ||
|
||
public string $site_name; | ||
|
||
public bool $guests_can_see_video_info; | ||
|
||
public array $streaming_bitrates; | ||
|
||
public static function group(): string | ||
{ | ||
return 'general'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.