Skip to content
Discussion options

You must be logged in to vote

I got this working - I replaced my data_source wih backpack_url('user/fetch/spouse?exclude=' . $this->crud->getCurrentEntry()->id), and I updated fetchSpouse like so:

    protected function fetchSpouse(Request $request)
    {
        $exclude = $request->input('exclude');
        return $this->fetch([
            'model' => User::class, // required
            'searchable_attributes' => ['lastNameFirstName'],
            'paginate' => 10, // items to show per page
            'searchOperator' => 'LIKE',
            'query' => function($model) use ($exclude) {
                return $exclude ?
                    $model->withTrashed()->where('id', '!=' , $exclude) :
                    $model

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by prescriptionlifeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant