Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5.4表格路由问题_Php_Laravel_Laravel 5.4 - Fatal编程技术网

Php Laravel 5.4表格路由问题

Php Laravel 5.4表格路由问题,php,laravel,laravel-5.4,Php,Laravel,Laravel 5.4,我有一个场景,其中续订合同可以有多个设备。我使用模式在续订的视图刀片中添加设备。问题是“提交”按钮不起作用。设备的“存储”功能位于合同控制器中,因此它会创建一个设备,然后将其与当前合同关联。 我的路线: Route::post('/storeDevice', 'RenewalController@storeDevice')->name('renewals.storeDevice'); Route::get('/home', 'HomeController@index')->

我有一个场景,其中续订合同可以有多个设备。我使用模式在续订的视图刀片中添加设备。问题是“提交”按钮不起作用。设备的“存储”功能位于合同控制器中,因此它会创建一个设备,然后将其与当前合同关联。
我的路线:

    Route::post('/storeDevice', 'RenewalController@storeDevice')->name('renewals.storeDevice');

Route::get('/home', 'HomeController@index')->name('home');
Route::resource('clients', 'ClientController');
Route::resource('users', 'UserController');
Route::resource('projects', 'ProjectController');
Route::resource('supports', 'SupportController');
Route::resource('tests', 'TestController');
Route::resource('renewals', 'RenewalController');
Route::resource('devices', 'DeviceController');
我的情态

<div class="modal fade container" id="addDevice">
 {!! Form::open([ 'method'=>'POST', 'action' => ['RenewalController@storeDevice', $renewal] ]) !!}

<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">New Device</h4>
    </div>
    <div class="modal-body">
        <p>
            {!! Form::label('name', 'Name:', ['class' => 'control-label']) !!}
            {!! Form::text('name', null, ['class' => 'form-control']) !!}
        </p>
        <p>
            {!! Form::label('startDate', 'Warranty Start:', ['class' => 'control-label']) !!}
            {!! Form::date('startDate', null) !!}
            &nbsp
            {!! Form::label('endDate', 'Warranty End:', ['class' => 'control-label']) !!}
            {!! Form::date('endDate', null) !!}
        </p>
    </div>
    <div class="modal-footer">
        <button type="submit" class="btn btn-success"> Submit </button>
        <button type="button" class="btn btn-default" data-dismiss="modal"> Close </button>
    </div>
</div>

{!! Form::close() !!}
</div>

{!!Form::open(['method'=>'POST','action'=>['RenewalController@storeDevice“,$renewal]])
&时代;
新装置

{!!Form::label('name','name:',['class'=>'controllabel'])
{!!Form::text('name',null,['class'=>'Form control'])

{!!Form::label('startDate','Warranty Start:',['class'=>'control label']) {!!Form::date('startDate',null)   {!!Form::label('endDate','Warranty End:',['class'=>'control label']) {!!Form::date('endDate',null)!!}

提交 接近 {!!Form::close()!!}
我有一些解决方案

  • 使用
    {{Form::submit('submit',array('class'=>'btn btn success'))}
    代替原始html按钮。或
  • 将id添加到表单,然后使用js单击提交按钮

    功能表单_提交(){
    document.getElementById(“form_id”).submit();
    }

  • 然后调用onclick事件按钮中的函数进行提交。
    尝试这两种解决方案希望它能起作用

    为什么要包含代码图像而不是代码本身?顺便说一句,告诉你的老板给你买一个合法的Windows副本,伙计。欢迎来到stack overflow,请在你的问题中包含代码,而不是引用图像。对不起,我可以编辑这个吗?但你还是没有回答我的问题sad@vladjamir错误显示了什么?无论如何,表单中应该包含
    {{form::token()}}
    @Sovary没有显示任何错误,只是当我单击cubmit按钮时,什么都没有发生