我想存储manager auth id
,在该表的数据库名称为“ ticket
”的页面中查看用户票证的内容,在列中命名为“ ticket_view_by_manager_id
”的页面“在此列中,我正在尝试存储管理员auth id
,当管理员打开该时间票证时,管理员身份ID将存储在此“ ticket_view_by_manager_id
”列中,
我的控制器
public function manager_assigned_Chat(Request $request, $ticket_id){
$this->validate($request, [
'ticket_view_by_manager_id' => 'required',
]);
$input = User_Ticket::find($ticket_id);
$input['ticket_view_by_manager_id'] = $request->submit;
$input->save();
}
我的路线
Route::post('user_ticket_chat{ticket_id}', 'Services\User_TicketController@manager_assigned_Chat')->name('user_ticket_chat{ticket_id}');
我的视图“显示所有用户票证列表”
<table id="myTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>slNo</th>
<th>Ticket ID</th>
<th>Subject</th>
<th>Status</th>
<th>Last Update</th>
<th>Created</th>
</tr>
</thead>
<tbody>
<form method="POST" action="{{ route('user_ticket_chat{ticket_id}')}}" enctype="multipart/form-data">
@csrf
@foreach ($my_tickets as $key=>$my_tickets_list)
<tr>
<td style="text-align:center"> {{ $key + 1 }} </td>
<td >{{ $my_tickets_list->ticket_id }}</td>
<td > <input type="hidden" name="submit" value="{{ Auth::user()->staff_id }}" href="ticket_chat{{ $my_tickets_list->ticket_id }}" >{{ $my_tickets_list->subject }}</td>
<td style="text-align:center">
@if($my_tickets_list->status == 'OPEN')
<span class="btn waves-effect waves-light btn-sm btn-success">OPEN</span>
@elseif($my_tickets_list->status == 'COMPLETE')
<span class="btn waves-effect waves-light btn-sm btn-info">COMPLETE</span>
@else($my_tickets_list->status == 'PENDING')
<span class="btn waves-effect waves-light btn-sm btn-danger">PENDING</span>
@endif
</td>
<td >{{$my_tickets_list->created_at->todatestring()}} </td>
<td >{{$my_tickets_list->updated_at->todatestring()}} </td>
</tr>
@endforeach
<input type="submit" value="Send.">
</form>
</tbody>
</table>
答案 0 :(得分:0)
您应该更改验证器。就像,请尝试以下操作:
$this->validate($request, [
'submit' => 'required',
]);
因为您没有从视图发送有关ticket_view_by_manager_id
的任何信息。
建议:可能是您的代码装饰不好。如果可以的话 看看。
答案 1 :(得分:0)
在您的web.php中
{% url '{{request.path}}' category='python' sub_cat='python-introduction' as target %}
{% if target %}
<div class="bg-secondary">active</div>
{% endif %}
在您的控制器中
if (Build.BRAND.equalsIgnoreCase("vivo")) {
TITLE = "vivo device detected";
PACKAGE_NAME = "com.vivo.permissionmanager";
PACKAGE_ACITIVITY = "com.vivo.permissionmanager.activity.BgStartUpManagerActivity";
Intent intent = new Intent();
intent.setComponent(new ComponentName(
PACKAGE_NAME, PACKAGE_ACITIVITY));
startActivity(intent);
}
在刀片视图中添加元标记:
Route::post('user_ticket_chat','Services\User_TicketController@manager_assigned_Chat')->name('user_ticket_chat');
在表中:
public function manager_assigned_Chat(Request $request){
$this->validate($request,[
'ticket_id' => 'required',
]);
$input = User_Ticket::find($ticket_id);
$input->ticket_view_by_manager_id = Auth::user()->id; // or Auth::user()->staff_id; in your case
$input->save();
}
现在使用Jquery AJAX请求:
<meta name="csrf-token" content="{{ csrf_token() }}">