示例#1
0
 /**
  * Handle user upload picture file events.
  */
 public function onUserUpload($event)
 {
     $user = $event->user;
     $file = $event->file;
     Log::info('user ' . $user->nickname . '[' . $user->email . '] uploaded a file:' . $file['original_file_name'] . '->' . $file['uploaded_full_file_name']);
     $log = ['user_id' => $user->id, 'url' => route('admin.upload'), 'type' => 'upload', 'content' => '管理员:上传了图片文件,图片原始文件名:' . $file['original_file_name'] . ',上传之后保存在服务器路径为' . $file['uploaded_full_file_name'] . '。'];
     SystemLogger::write($log);
 }
示例#2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(UserRequest $request, $id)
 {
     //
     $data = $request->all();
     $this->user->update($id, $data, 'manager');
     $log = ['user_id' => user('id'), 'url' => route('admin.user.edit', $id), 'type' => 'manager', 'content' => '管理员:超级管理员修改了id为' . $id . '的管理用户资料。'];
     SystemLogger::write($log);
     return redirect()->route('admin.user.index')->with('message', '修改管理员成功!');
 }