我的看法:<form action="/AddJuiceForm" method="POST"> @csrf; <div class="form-group"> <label for="FruitName">Fruit Name : </label> <input type="text" class="form-control" placeholder="Enter the Fruit Name" name="fruitname"> </div> <div class="form-group"> <label for="JuiceName">Juice Name : </label> <input type="text" class="form-control" placeholder="Enter the Juice Name" name="juicename"> </div> <button type="submit" class="btn btn-primary">Submit</button></form>我的路線/web.php:Route::post('AddJuiceForm','JuiceController@insertjuice ');我的控制器:<?phpnamespace App\Http\Controllers;use App\JuiceModel;use Illuminate\Http\Request;class JuiceController extends Controller{ public function insertjuice() { dd(request()->all); }}結(jié)果:我得到“空”作為輸出幫助我哪里出錯了?
Laravel 在表單提交后顯示空值
HUH函數(shù)
2022-12-23 13:13:53