0

I'm very new to this and can't understand what's happening. Tried multiple answers from other threads.

Trying to build a search form using Laravel and Octane. There is a problem with the action method on the form

<form role="form" id="form-buscar" action="{{ route('search') }}" method="POST">
     <textarea class="form-control" type="textarea" name="search" placeholder="Search..." required></textarea>
     <button class="btn btn-success pull-right" type="submit">Search</button>
</form>

And routes

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Laravel\Octane\Facades\Octane;
use Illuminate\Http\Response;

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

Octane::route('GET', '/search', function($request) {
    return Route::toResponse($request, view('search'));
});

The form is on the index page and when I tried to load it, I got the error

Route [/search] not defined.

pointing on action="{{ route('search') }}"

Jake
  • 59
  • 6

0 Answers0