Advertisement
refda21

WorkshopParticipantController

Mar 28th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers;
  4.  
  5. use App\Http\Resources\WorkshopBookingResource;
  6. use App\Models\WorkshopBooking;
  7. use App\Models\WorkshopParticipant;
  8. use Illuminate\Http\Request;
  9.  
  10. class WorkshopParticipantController extends Controller
  11. {
  12.  
  13. public function store(Request $request)
  14.     {
  15.           $p = new WorkshopParticipant();
  16.         $p->participant_name = $request->get('participant_name');
  17.                 $p->participant_fullname = $request->get('participant_fullname');
  18.                 $p->participant_dob = $request->get('participant_dob');
  19.                 $p->participant_gender = $request->get('participant_gender');
  20.                 $p->participant_profession = $request->get('participant_profession');
  21.                 $p->participant_mobilenumber = $request->get('participant_mobilenumber');
  22.                 $p->participant_email = $request->get('participant_email');
  23.  
  24.                 $p->save();
  25.    
  26.                 $p = new WorkshopBookingResource($p->load('workshopBookings'));
  27.         return response($p);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement