Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

531
Views
Aprobar y rechazar en laravel

Quiero otorgar una función para aprobar y rechazar el botón que se encuentra en el panel de administración y mostrar el resultado como comentarios: pendiente/aceptado/rechazado en el panel del usuario.

aquí está mi vista de administrador

tablero.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>

consulte esta foto ingrese la descripción de la imagen aquí

Y cuando haga clic en el botón Aceptar, irá a la tabla de reservas aceptadas, consulte aquí ingrese la descripción de la imagen aquí .

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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>

En su controlador

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!