mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update AdminController
This commit is contained in:
parent
a72d0964ac
commit
a71a2c96b7
1 changed files with 21 additions and 0 deletions
|
@ -258,4 +258,25 @@ class AdminController extends Controller
|
|||
$messages = Contact::orderByDesc('id')->paginate(10);
|
||||
return view('admin.messages.home', compact('messages'));
|
||||
}
|
||||
|
||||
public function messagesShow(Request $request, $id)
|
||||
{
|
||||
$message = Contact::findOrFail($id);
|
||||
return view('admin.messages.show', compact('message'));
|
||||
}
|
||||
|
||||
public function messagesMarkRead(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'id' => 'required|integer|min:1'
|
||||
]);
|
||||
$id = $request->input('id');
|
||||
$message = Contact::findOrFail($id);
|
||||
if($message->read_at) {
|
||||
return;
|
||||
}
|
||||
$message->read_at = now();
|
||||
$message->save();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue