0
votes

I have a form request in my website where the user can send request data to the admin and must input an email too (no login needed). This request is in my tb_req (in my UserAddingController).

After the user sends it, the data will show on the admin dashboard (with the same table -> RequestDataController). What I want to do is;

  • When the admin accepts the data, it will send the data on tb_req to the master table and the data in tb_req will deleted/move into master table.
  • If the admin declines it, the data will deleted from the tb_req and get email notification too (in the data not approved).

I am using Laravel 5.5

Here is the necessary code:

UserAddingDataController

Form Adding Data (show in UserAddingDataController)

RequestDataController

MasterDataController - (I want to put the request aprroved here)

1

1 Answers

0
votes

you can set Event for your action; look at laravel documents https://laravel.com/docs/5.5/eloquent#events and https://laravel.com/docs/5.5/events

you can set a event for creating or updating your model when admin accepets the request, and do anything for sending and setting data

i hope can help you