diaREact/app/Http/Controllers/UserController.php

26 lines
593 B
PHP

<?php
namespace App\Http\Controllers;
use App\Http\Requests\User\WordCheckRequest;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
class UserController extends Controller
{
public function first()
{
return view('user.first');
}
public function storeFirst(WordCheckRequest $request)
{
$validated = $request->validated();
$user = User::where('id', Auth::user()->getAuthIdentifier())->firstOrFail();
$user->checkword = $validated['checkword'];
$user->save();
return response()->json(['success' => true]);
}
}