<select name="id_business" class="form-control input-xlg">
<option value="">Select User </option>
@foreach($users as $user)
<option value="{{$user->id}}">{{$user->name}}</option>
@endforeach
</select>
在我的控制器中,我已经走了这么远,但它无法正常工作:
public function store(Request $request)
{
$businesses = new Businesses();
$businesses->name = $request->name;
$businesses->user_create_id = Auth::user()->id;
$user= Businesses_Users::first();
if($businesses->save())
{
$request->id_business;
$user->id = Businesses_Users::find($request->id_business);
$user->id_business = $businesses->id;
return redirect()->route('businesses',$businesses->id)->with('success', sprintf('Business successfully created.'));
}
else
{
return redirect()->back()->with('error', sprintf('An unexpected error occurred.Please fill a report form on this issue.'));
}
}
提前致谢。
答案 0 :(得分:1)
缺少<h1>{% now "l d F H:i" %}</h1>
功能
save()