Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table class="table table-bordered">
- <tr>
- <td> Name </td>
- </tr>
- @foreach($data as $value )
- <tr>
- <td> {{ $value->username }} </td>
- <td> <a href="edit/{{ $value->id }}"><input type="submit" name="update" value="Update" class="btn-primary"></a> </td>
- </tr>
- @endforeach
- </table>
- public function edit($id)
- {
- $edd = User::find($id);
- //dd($edd);
- return view('AdminUpdate', ['edd' => $edd]);
- }
- public function adminedit($id, Request $request)
- {
- // Add Validation
- $users = User::find($id);
- $users->username = $request->get('username');
- $users->email = $request->get('email');
- $users->save();
- return redirect('AdminPanel');
- }
- <form action="adminedit/{{ $edd->id }}" method="post" enctype="multipart/form-data">
- {{ method_field('PUT') }}
- {{ csrf_field() }}
- <div class="form-group">
- <label>Username : *</label>
- <input type="text" class="form-control" name="username" value="{{$edd->username}}" placeholder="Enter Your Username" required>
- </div>
- <div class="form-group">
- <label>Email : *</label>
- <input type="email" class="form-control" name="email" value="{{$edd->email}}" placeholder="Enter Your Username" required>
- </div>
- <div class="form-group">
- <label>Password : *</label>
- <input type="password" class="form-control" name="password" value="{{$edd->password}}" placeholder="Enter Your Password" required>
- </div>
- <div class="form-group">
- <label>Upload Profile Picture :</label>
- <input type="file" class="form-control-file" name="file_img" aria-describedby="fileHelp">
- <small id="fileHelp" class="form-text text-muted">If U Want , U Can Skip Upload A Profile Picture</small>
- </div>
- <input type="submit" class="btn btn-primary" value="Update User">
- </form>
- Route::get('/edit/{id}', 'AdminPanelController@edit');
- Route::post('/adminedit/{id}', 'AdminPanelController@adminedit');
Add Comment
Please, Sign In to add comment