最新回答 / 慕萊塢1086289
修改的路由會攜帶一個id參數(shù),你要根據(jù)這個id獲取Model,由于form是跟增加使用的一個,所以在input中的value在賦值時需要增加isset判斷,然后提交。之所以提交沒改變,其根本就是你沒拿到id對應的Model,少這一步,希望對你有幫助。。
2017-04-12
Type error: Argument 1 passed to Illuminate\Http\RedirectResponse::withInput() must be of the type array, object given, called in D:\phpStudy\WWW\laravel\app\Http\Controllers\StudentController.php,報這個錯誤可以在控制器這樣寫return redirect()->back()->withErrors($validator)->withInput($request->input());
2017-04-08
Type error: Argument 1 passed to Illuminate\Http\RedirectResponse::withInput() must be of the type array, object given, called in D:\phpStudy\WWW\laravel\app\Http\Controllers\StudentController.php on line 62
求解,求解
求解,求解
2017-04-08
<input type="text" name="Student[age]"
value="{{ isset($student->age) ? $student->age : old('Student')['age'] }}"
class="form-control" id="age" placeholder="請輸入學生年齡">
value="{{ isset($student->age) ? $student->age : old('Student')['age'] }}"
class="form-control" id="age" placeholder="請輸入學生年齡">
2017-04-03
<input type="radio" name="Student[sex]" value="20"
@if(isset($student->sex) && $student->sex == 20)
checked=""
@else
''
@endif
> 女
@if(isset($student->sex) && $student->sex == 20)
checked=""
@else
''
@endif
> 女
2017-04-03
最贊回答 / weixia
laravel 5.4 ?也遇到這個問題 ,找到最后發(fā)現(xiàn)是 中間件 文件kernel.php。的?protected $middlewareGroups = [】// \App\Http\Middleware\VerifyCsrfToken::class, ?這個 中間件 注釋掉。就可以了!
最贊回答 / 就不告訴你啦
這個是因為laravel默認開啟了Csrf驗證,只需要在代碼form中添加一個隱藏的input即可,添加代碼如下<...code...>你可以試試,一定要添加在form標簽內部。<...圖片...>
TokenMismatchException in VerifyCsrfToken.php line 67:
大神們,我實在解決不了了
大神們,我實在解決不了了
2017-04-02
如果遇到pull forget flash 失效的時候,看看是不是用dd輸出 ,概要var_dump,echo,print_r輸出;
2017-04-02