You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
531 B
PHTML
28 lines
531 B
PHTML
2 years ago
|
<?php
|
||
|
|
||
|
namespace App\Http\Controllers;
|
||
|
|
||
|
use App\Models\Setting;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
class SettingController extends Controller
|
||
|
{
|
||
|
public function index()
|
||
|
{
|
||
|
return inertia('Setting/Index', [
|
||
|
'settings' => Setting::all(),
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
public function update(Request $request)
|
||
|
{
|
||
|
$request->validate([
|
||
|
'email' => 'required|email',
|
||
|
]);
|
||
|
|
||
|
Setting::where('key', 'DESTINATION_MAIL')->update([
|
||
|
'value' => $request->email,
|
||
|
]);
|
||
|
}
|
||
|
}
|