How to save updated data only after admin verification in Laravel
I have two users: one admin and another simple user. When user wants to edit data, it goes request to admin like "pending for verification"; only after verifying, data will update. This is image for status column of table:
When data is edited from user, status is 4, and when verified, it must be 5. Can you help me how can I save old data upto when new data is not verified and how to replace it after verification?
php laravel
add a comment |
I have two users: one admin and another simple user. When user wants to edit data, it goes request to admin like "pending for verification"; only after verifying, data will update. This is image for status column of table:
When data is edited from user, status is 4, and when verified, it must be 5. Can you help me how can I save old data upto when new data is not verified and how to replace it after verification?
php laravel
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58
add a comment |
I have two users: one admin and another simple user. When user wants to edit data, it goes request to admin like "pending for verification"; only after verifying, data will update. This is image for status column of table:
When data is edited from user, status is 4, and when verified, it must be 5. Can you help me how can I save old data upto when new data is not verified and how to replace it after verification?
php laravel
I have two users: one admin and another simple user. When user wants to edit data, it goes request to admin like "pending for verification"; only after verifying, data will update. This is image for status column of table:
When data is edited from user, status is 4, and when verified, it must be 5. Can you help me how can I save old data upto when new data is not verified and how to replace it after verification?
php laravel
php laravel
edited Nov 13 '18 at 8:54
Armali
7,020936100
7,020936100
asked Nov 13 '18 at 7:15
shankar bhattshankar bhatt
62
62
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58
add a comment |
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58
add a comment |
2 Answers
2
active
oldest
votes
You can use this way to fix this problem. (Of course, this is my point)
Save the data in a table and add a new column with the status name in this field to check if the data has been verified.
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
add a comment |
I think something like that:
- Create temp table with foreign key for current table
- Create temp model
User change:
$newItem = new TempModel($someRequestData);
$item->some_foreign_key_name = $request->input('id');
$item->save();Admin verify:
$newItem = TempModel::where('some_foreign_key_name', $request->input('id'))->first();
$oldItem = Model::find($request->input('id'));
$oldItem->fill($newItem->toArray());
$oldItem->save();
$newItem->delete();add $guarded to current model, if you are not using $fillable:
protected $guarded = ['some_foreign_key_name'];
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275719%2fhow-to-save-updated-data-only-after-admin-verification-in-laravel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use this way to fix this problem. (Of course, this is my point)
Save the data in a table and add a new column with the status name in this field to check if the data has been verified.
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
add a comment |
You can use this way to fix this problem. (Of course, this is my point)
Save the data in a table and add a new column with the status name in this field to check if the data has been verified.
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
add a comment |
You can use this way to fix this problem. (Of course, this is my point)
Save the data in a table and add a new column with the status name in this field to check if the data has been verified.
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them
You can use this way to fix this problem. (Of course, this is my point)
Save the data in a table and add a new column with the status name in this field to check if the data has been verified.
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them
edited Nov 13 '18 at 9:31
answered Nov 13 '18 at 9:12
reza baghieereza baghiee
6419
6419
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
add a comment |
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Yes, i understand that but need code for save temp data and replace it when approving in laravel.
– shankar bhatt
Nov 13 '18 at 9:17
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
Save the information in a different table. An interface table !!! Then, when the administrator verified that using the Identity Interface, paste these new values, then erase the new values from the interface table after inserting them.
– reza baghiee
Nov 13 '18 at 9:28
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
need on same table as temp data
– shankar bhatt
Nov 13 '18 at 9:36
add a comment |
I think something like that:
- Create temp table with foreign key for current table
- Create temp model
User change:
$newItem = new TempModel($someRequestData);
$item->some_foreign_key_name = $request->input('id');
$item->save();Admin verify:
$newItem = TempModel::where('some_foreign_key_name', $request->input('id'))->first();
$oldItem = Model::find($request->input('id'));
$oldItem->fill($newItem->toArray());
$oldItem->save();
$newItem->delete();add $guarded to current model, if you are not using $fillable:
protected $guarded = ['some_foreign_key_name'];
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
add a comment |
I think something like that:
- Create temp table with foreign key for current table
- Create temp model
User change:
$newItem = new TempModel($someRequestData);
$item->some_foreign_key_name = $request->input('id');
$item->save();Admin verify:
$newItem = TempModel::where('some_foreign_key_name', $request->input('id'))->first();
$oldItem = Model::find($request->input('id'));
$oldItem->fill($newItem->toArray());
$oldItem->save();
$newItem->delete();add $guarded to current model, if you are not using $fillable:
protected $guarded = ['some_foreign_key_name'];
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
add a comment |
I think something like that:
- Create temp table with foreign key for current table
- Create temp model
User change:
$newItem = new TempModel($someRequestData);
$item->some_foreign_key_name = $request->input('id');
$item->save();Admin verify:
$newItem = TempModel::where('some_foreign_key_name', $request->input('id'))->first();
$oldItem = Model::find($request->input('id'));
$oldItem->fill($newItem->toArray());
$oldItem->save();
$newItem->delete();add $guarded to current model, if you are not using $fillable:
protected $guarded = ['some_foreign_key_name'];
I think something like that:
- Create temp table with foreign key for current table
- Create temp model
User change:
$newItem = new TempModel($someRequestData);
$item->some_foreign_key_name = $request->input('id');
$item->save();Admin verify:
$newItem = TempModel::where('some_foreign_key_name', $request->input('id'))->first();
$oldItem = Model::find($request->input('id'));
$oldItem->fill($newItem->toArray());
$oldItem->save();
$newItem->delete();add $guarded to current model, if you are not using $fillable:
protected $guarded = ['some_foreign_key_name'];
answered Nov 13 '18 at 9:41
IndianCodingIndianCoding
1,044119
1,044119
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
add a comment |
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
thank you for code.
– shankar bhatt
Nov 13 '18 at 10:45
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275719%2fhow-to-save-updated-data-only-after-admin-verification-in-laravel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
any one is their for help?
– shankar bhatt
Nov 13 '18 at 7:24
I think you need to create two separate table, 1. store users verified data and another for change data which on pending status, Once admin is verified then you need to replace users data with change data and change status to verified. You should store change data in JSON in database
– Madhusudan
Nov 13 '18 at 7:29
on edit with simple user u can create another row in your database table with edited data and pending status as temp, after admin accept the edited data, replace this data on with main data and delete this temp data, and if admin refuse it, only delete temp data
– Behzad Dadashpour
Nov 13 '18 at 7:30
Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 7:41
#behzad-dadashpour Do you help me by providing code to save temp data and replace it when verified?
– shankar bhatt
Nov 13 '18 at 8:58