我试图通过变量将一个页面中的表单的输入发送到另一页面上的表单,但它对我不起作用。这是第一页的表格:
<form method="POST" action="{{ route('invite') }}">
@csrf
<div class="form-group row">
<label for="username" class="col-md-4 col-form-label text-md-right">{{ __('Username') }}</label>
<div class="col-md-6">
<input id="username" type="username" class="form-control @error('username') is-invalid @enderror" name="username" value="{{ old('username') }}" >
@error('username')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Invite') }}
</button>
</div>
</div>
</form>
和第一页的控制器:
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class InviteController extends Controller
{
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::REGISTER;
/**
* Create a new controller instance.
*
* @return void
*/
我尝试过在这段代码中使用会话方法,但它不起作用。我尝试了 POST 方法,但我不知道如何正确实现它。
手掌心
忽然笑