v0.5.12a - Fixed store of event

This commit is contained in:
Anders 2020-08-07 12:59:21 +02:00
parent 376f37da8c
commit d921803dfd
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class EventController extends Controller
$requestBody = $request->validate([ $requestBody = $request->validate([
"name" => "required|max:255", "name" => "required|max:255",
"accountable" => "required|max:255", "accountable" => "required|max:255",
"description" => "required|max:255", "description" => "required",
"date" => "required" "date" => "required"
]); ]);
@ -114,7 +114,7 @@ class EventController extends Controller
public function signups(Request $request) public function signups(Request $request)
{ {
// Find every event you have clicked on. And find all users to that event, and the event name itself. // Find every event you have clicked on. And find all users to that event, and the event name itself.
$events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('events', 'events.id', '=', 'user_events.event_id')->where('event_id', $request->event)->get(); $events = UserEvent::join('users', 'users.id', '=', 'user_events.user_id')->join('events', 'events.id', '=', 'user_events.event_id')->where('event_id', $request->event_id)->get();
if (count($events) == 0) if (count($events) == 0)
$events = Event::where('id', $request->event)->get(); $events = Event::where('id', $request->event)->get();