mirror of
https://github.com/10h30/Test-Laravel-Validation.git
synced 2026-06-05 15:07:56 +09:00
Task 7 - update forbidden field
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\UpdateUserRequest;
|
||||
use App\Models\User;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function update(User $user, UpdateUserRequest $request)
|
||||
{
|
||||
// TASK: change this line to not allow is_admin field to be updated
|
||||
// Update only the fields that are validated in UpdateUserRequest
|
||||
$user->update($request->all());
|
||||
|
||||
return 'Success';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user