I have a section on the home page of my site that contains a form called @section('registration-form')
. I am unable to create a separate blade file like register.blade.php
and then @yield it into the home page because the form yields after the page loads, messing up my javascript. Either way, I prefer to create a route that points directly to the form section of my page, not the entire page.
The purpose of doing this is to create a custom form, which needs a route from routes/web.php.
I'm using Laravel 5.4.
Is it possible to create a Route::get()
that grabs the form @section('registration-form')
only?
THE CODE:
home.blade.php
<!--- content from the home page exists here --->
<!--- form ---->
@section('registration-form')
<div class="col-lg-12">
<form method="POST" action="{{ `Syntax for GET request?` }}">
{{ csrf_field() }}
<div class="form-group" id="fname">
<label for="name">First Name:</label>
<input name="fname">
</div>
<div class="form-group" id="email">
<label for="email">Email address:</label>
<input id="email" type="email" name="email" value="" required>
</div>
<div class="form-group" id="password">
<label for="pwd">Password:</label>
<input id="password" type="password" name="password" required>
</div>
<!---- more form questions ---->
@stop
<!--- more content from home page exists here --->
Routes/web.php
Route::get( `HOW DO I POINT TO @section('registration-form')??` )