‘这是我的控制器’‘我需要帮助,当我点击对象时,我想从phpmyadmin获取行数据,谢谢大家’
公共函数存储(请求$request){
$this->middleware('auth');
$tours = new tour();
$tours->name=$request->input('name');
$tours->date=$request->input('date');
$tours->price=$request->input('price');
$tours->hotel=$request->input('hotel');
$tours->created_at=$request->input('created_at');
$tours->service=$request->input('service');
$tours->some=$request->input('some');
if($request->hasFile('picture')){
$file=$request->file('picture');
$extension =$file->getClientOriginalName();
$filename =time() .'.'.$extension;
$file->move(public_path('images'),$filename);
$tours->picture=$filename;
}
$tours->save();
return redirect('admin/tour');
}“这是我的观点”
<div class="bc" style=" border-radius: 4px; width: 70%; height:45rem;">
<h4 style="text-align: center; position: relative; top:15px;">Tur Haqqında Məlumat</h4>
<strong style=" position: relative; top:15px;">Qiymət</strong>
<p style=" position: relative; top:15px; width: 100%; font-weight: 400; font-family: 'Times New Roman', Times, serif;" name='price'>{{$tour->price}} AZN</p>
<hr/>发布于 2020-05-06 01:28:42
您需要将$tours传递给您的视图:
return redirect('admin/tour', ['tour'=> $tours]); 顺便说一句,我将使用$tour而不是您现在在控制器中使用的复数版本$tours。
https://stackoverflow.com/questions/61618524
复制相似问题