Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Information about deleted_at in Laravel 5. #83

Closed
wants to merge 2 commits into from
Closed

Information about deleted_at in Laravel 5. #83

wants to merge 2 commits into from

Conversation

jakubthedeveloper
Copy link
Contributor

Information about deleted_at in Laravel 5 and form request.

Information about deleted_at in Laravel 5 and form request.
@Dreknor
Copy link

Dreknor commented Oct 6, 2017

Where should your function be integrated?

@jakubthedeveloper
Copy link
Contributor Author

@Dreknor In request class.

@anurbol
Copy link

anurbol commented Jan 19, 2018

Well instead of treating symptoms, let's solve the reason. I've made pull request for it: #92

@anurbol anurbol mentioned this pull request Jan 21, 2018
@webenformasyon
Copy link

webenformasyon commented Mar 21, 2018

Maybe adding readme some text like this can help not only for deleted_at but other fields exist in DB but not in request array.

/*
if you want to check unique_with fields that do not exist in input array 
but exist in database you can add these values to request array and check like this
*/
        $requestData = array_merge(request()->all(), ['dbField1' => $value1, 'dbField2' => $value2]);

        //e.g for deleted ad 
       //$requestData = array_merge(request()->all(), ['dbField1' => $value1, 'deleted_at' => null]);

        $rules_create = [
            'inputField' => 'unique_with: TABLE, dbField1, dbField2',
            //'inputField' => 'unique_with: TABLE, dbField1, deleted_at', 
        ]; 
        $validator = Validator::make($requestData, $rules_create);

        if ($validator->fails()) {

        }else{

        }

@felixkiss felixkiss changed the base branch from master to deleted-at-caveat February 12, 2019 18:14
@felixkiss
Copy link
Owner

Merged in #101
Thanks!

@felixkiss felixkiss closed this Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants