Mehr Bilder, Arbeit am Backend

This commit is contained in:
2026-03-29 21:55:35 +02:00
parent 7c3da000f9
commit 44eb81e99a
18 changed files with 238 additions and 14 deletions

View File

@@ -83,4 +83,27 @@ class PreApplicationController extends Controller
}
return ["messageStatus" => "failure", "errorMessage" => __("controller_messages.PreApplicationController.event_not_found")];
}
public static function applicationsPaginated(){
return PreApplications::paginate(50);
}
public function addApplication(Request $request){
if(Auth::check()){
try {
$pa = new PreApplications();
$pa->first_name = $request->input('first_name');
$pa->last_name = $request->input('last_name');
$pa->location = $request->input('location');
$pa->passport_type = $request->input('passport_type');
$pa->reference_number = $request->input('reference_number');
$pa->event_id = $request->input('event_id');
$pa->email = $request->input('email');
$pa->save();
}
catch(\Exception $e){
return ["messageStatus" => "failure", "errorMessage" => $e->getMessage()];
}
}
}
}

View File

@@ -81,4 +81,14 @@ class WebsiteController extends Controller
}
abort(404);
}
public function editApplications(){
if(Auth::check()){
return response()
->view('application.edit', ['applications' => PreApplicationController::applicationsPaginated()])
->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
}
abort(404);
}
}

View File

@@ -23,7 +23,7 @@ class ChaosEvents extends Model
}
public static function getActiveEvents(){
return self::where('to_date_internal', '>=', today())
return self::where('active', 1)->where('to_date_internal', '>=', today())
->where('from_date_internal', '<=', today())->get();
}
}