Skip to content
Permalink
Browse files

fix setting alt text on photos

  • Loading branch information
aaronpk committed Feb 9, 2020
1 parent 6a9c9b9 commit fb8759330177c3f703aa9f47f5351d376e339222
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/Http/Controllers/EventController.php
@@ -257,16 +257,16 @@ public function delete_response(Event $event, Response $response) {
public function save_alt_text(Event $event) {
Gate::authorize('manage-event', $event);

$response = Response::where('event_id', $event->id)->where('id', request('response_id'))->first();
$photo = ResponsePhoto::where('event_id', $event->id)->where('id', request('photo_id'))->first();

if(!$response) {
if(!$photo) {
return response()->json([
'result' => 'error',
]);
}

$response->set_photo_alt(request('url'), request('alt'));
$response->save();
$photo->alt = request('alt');
$photo->save();

return response()->json([
'result' => 'ok',

0 comments on commit fb87593

Please sign in to comment.
You can’t perform that action at this time.