Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. MethodNotAllowedHttpException
  2.  
  3. <html>
  4. <head>
  5.  
  6. <body>
  7.  
  8. <form action="edit{{$users[0]->id}}" method="post" enctype="multipart/form-data">
  9.  
  10. {{ method_field('PUT') }}
  11. {{ csrf_field() }}
  12.  
  13. <div class="form-group">
  14. <label>Name : *</label>
  15. <input type="text" class="form-control" name="name" value="{{$users[0]->name}}" required>
  16. </div>
  17.  
  18. <div class="form-group">
  19. <label>Username : *</label>
  20. <input type="text" class="form-control" name="username" value="{{$users[0]->username}}" required>
  21. </div>
  22.  
  23. <div class="form-group">
  24. <label>Password : *</label>
  25. <input type="password" class="form-control" name="password" value="{{$users[0]->pw}}" required>
  26. </div>
  27.  
  28. <div class="form-group">
  29. <label>Upload Profile Picture :</label>
  30. <input type="file" class="form-control-file" name="file_img" aria-describedby="fileHelp">
  31. <small id="fileHelp" class="form-text text-muted">If U Want , U Can Skip Upload A Profile Picture</small>
  32. </div>
  33.  
  34. <input type="submit" class="btn btn-primary" name="submit" value="Update">
  35.  
  36. </form>
  37.  
  38. </body>
  39. </html>
  40.  
  41. <?php
  42.  
  43. namespace AppHttpControllers;
  44.  
  45. use IlluminateHttpRequest;
  46. use DB;
  47.  
  48. class RegViewController extends Controller
  49. {
  50.  
  51. public function index()
  52. {
  53. return view('RegView');
  54. }
  55.  
  56. public function show($id) {
  57. $users = DB::select('select * from academic where id = ?',[$id]);
  58. return view('RegViewUpdate',['users'=>$users]);
  59. }
  60.  
  61. public function edit(Request $request, $id)
  62. {
  63. $name = $request->input('name');
  64.  
  65. DB::update('update academic set name = ? where id = ?',[$name,$id]);
  66. echo "Record updated successfully.<br/>";
  67.  
  68. }
  69.  
  70. }
  71.  
  72. Route::get('edit/{id}','RegViewController@show');
  73. Route::post('edit{id}','RegViewController@edit');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement