Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tbody>
- @foreach ($pendingDocumentLists as $list)
- <tr class = "info">
- <td>{{ $list->title }}</td>
- <td>
- @if (Auth::id() == $list->approver_id)
- <form class = "form-inline" method = "post" action = "{{ route ('document.pending', $list->id) }}">
- <div class = "form-group">
- <a href = "{{ route ('document.pending', $list->id) }}">
- <input type = "checkbox" name = "approve" value = "yes">
- <strong>Approve</strong>
- </input>
- </a>
- </div>
- <div class = "form-group">
- <a href = "{{ route ('document.pending', $list->id) }}">
- <input type = "checkbox" name = "reject">
- <strong>Reject</strong>
- </input>
- </a>
- </div>
- </form>
- @endif
- </td>
- </tr>
- @endforeach
- </tbody>
- public function updateIsApprove($id)
- {
- $document = Document::find($id);
- if($approve == "yes")
- {
- $document->isApprove = 1;
- $document->save();
- }
- }
- Route::get('/documents/pending',
- [
- 'uses' => 'AppHttpControllersDocumentController@documentsSentForApproval',
- 'as' => 'document.pending',
- ]);
- Route::post('/documents/pending/approve/{id}',
- [
- 'uses' => 'AppHttpControllersDocumentController@updateIsApprove',
- 'as' => 'document.pending',
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement