Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

538
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda