Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
namespace App\Http\Controllers;
use App\Http\Middleware\RedirectIfAuthenticated;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View;
use Spatie\RouteAttributes\Attributes\Get;
use Spatie\RouteAttributes\Attributes\Post;
use Spatie\RouteAttributes\Attributes\Prefix;
#[Prefix('contact')]
class ContactController extends Controller
{
/**
* @return Application|Factory|View
*/
#[Get('/form', name: "contact.index", middleware: RedirectIfAuthenticated::class)]
public function index(): View|Factory|Application {
return view("contact");
}
#[Post('/form', name: "contact.submit", middleware: RedirectIfAuthenticated::class)]
public function submit() {
// TODO process contact form
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment