<?php

use App\Http\Controllers\BlogController;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\PreApplicationController;
use App\Http\Controllers\WebsiteController;
use App\Http\Controllers\TickerController;
use Illuminate\Support\Facades\Route;


Route::get('/', [WebsiteController::class, 'index']);

Route::get('/ueberuns', [WebsiteController::class, 'about'])->name('about');
Route::get('/kontakt', [WebsiteController::class, 'contact'])->name('contact');
Route::get('/impressum', [WebsiteController::class, 'imprint'])->name('imprint');
Route::get('/services', [WebsiteController::class, 'services'])->name('services');
Route::get('/neuigkeiten', [WebsiteController::class, 'news'])->name('news');

Route::get('/vorbeantragen', [WebsiteController::class, 'apply'])->name('apply');
Route::post('/vorbeantragen/absenden', [PreApplicationController::class, 'send']);

Route::get('/intern/registrieren', [WebsiteController::class, 'showRegister']);
Route::post('/intern/registrieren/abschicken', [LoginController::class, 'register']);

Route::get('/intern/anmelden', [WebsiteController::class, 'showLogin']);
Route::post('/intern/anmelden/einloggen', [LoginController::class, 'login']);

Route::get('/intern/abmelden', function(){
    Auth::logout();
    return redirect("/");
})->name('logout');

Route::get('/intern/ticker', [WebsiteController::class, 'editTicker'])->name('editTicker');
Route::delete('/intern/ticker/remove', [TickerController::class, 'deleteTicker']);
Route::put('/intern/ticker/add', [TickerController::class, 'addTicker']);


Route::get('/intern/nachrichten', [WebsiteController::class, 'editNews'])->name('editNews');
Route::post('/intern/nachrichten/add', [BlogController::class, 'addBlog']);
Route::delete('/intern/nachrichten/delete', [BlogController::class, 'deleteBlog']);
Route::put('/intern/nachrichten/edit', [BlogController::class, 'editBlog']);
