我已經制作了一個表單來提交用戶數據,但是當我單擊提交按鈕時,它顯示錯誤“找不到對象”查看文件`@extends('layout') @section('content') <h1 class="title">Simple Form</h1> <form method="POST" action="/projects"> @csrf <div class="field"> <label class="label" for="name">Name</label> <div class="control"> <input type="text" class="input" name="name" placeholder="Enter Name"> </div> </div> <div class="field"> <label class="label" for="email">E-mail</label> <div class="control"> <input type="text" class="input" name="email" placeholder="Enter E-mail Address"> </div> </div> <div class="field"> <label class="label" for="pincode">Pincode</label> <div class="control"> <input type="text" class="input" name="pincode" placeholder="Enter Pincode"> </div> </div> <div class="field"> <div class="control"> <button type="submit" class="button">Submit</button> </div> </div> </form>@endsection
1 回答

鳳凰求蠱
TA貢獻1825條經驗 獲得超4個贊
您不需要在 url 前使用/。網頁.php:
Route::post('projects','ATGController@store');
查看文件:
<form method="POST" action="{{ url('projects') }}">
如果這不能解決問題,請檢查 .env 文件中的 app_url。
- 1 回答
- 0 關注
- 109 瀏覽
添加回答
舉報
0/150
提交
取消