feat: 增加自定义头像上传、自动压缩与自动清理功能,统一全站头像路径读取逻辑
This commit is contained in:
@@ -36,17 +36,17 @@ class RoomManagerController extends Controller
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'room_name' => 'required|string|max:100|unique:rooms,room_name',
|
||||
'room_des' => 'nullable|string|max:500',
|
||||
'room_owner' => 'nullable|string|max:50',
|
||||
'room_name' => 'required|string|max:100|unique:rooms,room_name',
|
||||
'room_des' => 'nullable|string|max:500',
|
||||
'room_owner' => 'nullable|string|max:50',
|
||||
'permit_level' => 'required|integer|min:0|max:15',
|
||||
'door_open' => 'required|boolean',
|
||||
'door_open' => 'required|boolean',
|
||||
], [
|
||||
'room_name.unique' => '房间名称已存在,请换一个名称。',
|
||||
]);
|
||||
|
||||
// 设置新建房间的默认值
|
||||
$data['room_keep'] = false; // 新建房间均为非系统房间,可删除
|
||||
$data['room_keep'] = false; // 新建房间均为非系统房间,可删除
|
||||
$data['build_time'] = now();
|
||||
|
||||
$room = Room::create($data);
|
||||
@@ -62,12 +62,12 @@ class RoomManagerController extends Controller
|
||||
public function update(Request $request, Room $room): RedirectResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'room_name' => 'required|string|max:100',
|
||||
'room_des' => 'nullable|string|max:500',
|
||||
'room_name' => 'required|string|max:100',
|
||||
'room_des' => 'nullable|string|max:500',
|
||||
'announcement' => 'nullable|string|max:500',
|
||||
'room_owner' => 'nullable|string|max:50',
|
||||
'room_owner' => 'nullable|string|max:50',
|
||||
'permit_level' => 'required|integer|min:0|max:15',
|
||||
'door_open' => 'required|boolean',
|
||||
'door_open' => 'required|boolean',
|
||||
]);
|
||||
|
||||
$room->update($data);
|
||||
|
||||
Reference in New Issue
Block a user