validate([ 'name' => 'required|string|max:100', ]); MsDoctor::create($request->all()); return redirect()->back()->with('Success', 'Doctor create successfully.'); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $request->validate([ 'name' => 'required|string|max:100', ]); $id->update($request->all()); return redirect()->back()->with('Success', 'Doctor create successfully.'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }