Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

540
Visualizações
Approve and reject in laravel

I want to give function to both approve and decline button that is in admin dashboard and display the result as remarks:pending/accepted/decline in user's dashboard.

here is my admin view

dashboard.php.blade

<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
    <thead>
    <tr>
    <th hidden>Id</th>
    <th>Name</th>
    <th>Equipment</th>
    <th>Reservation Date</th>
    <th>Rooms</th>
    <th>Action</th>
    </tr>
    </thead>
   <tbody>
   @foreach ($res as $resdata)
   <tr>
   <td hidden> </td>
   <td>{{$resdata->name}} </td>
   <td>{{$resdata->Name_item}}</td>
   <td>{{$resdata->dt_item}}</td>
   <td>{{$resdata->room_item}}  </td>
   <td>
   <button type="button" class="btn btn-primary btn-sm" >Accept <i class="fas fa-chevron-right"></i></button></a>
   <button type="button" class="btn btn-danger btn-sm">Decline <i class="fas fa-times"></i></button>
  </td>
  </tr>
@endforeach
</tbody>
</table>

refer to this photo enter image description here

And when I click the accept button it will go to the accepted reservation table please refer here enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

<form action="{{route(YourRoute/{id})}}"
<button type="submit" class="btn btn-primary btn-sm" >Accept <i class="fas fa-chevron-right"></i></button></a>
</form>

In Your Controller

public function ($id){
  $reservation = Reservation::find($id);

  $reservation->status = true ;

  return redirect()->back()->with('message' , 'Success');
}

public function index (){
  $reservation = Reservation::where('status' , true);

  return view()->with('reservations' , $reservation);
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda