Support the ongoing development of Laravel.io →
Laravel
Last updated 3 weeks ago.
0

solution find here

final solution for me

/**
     * Retrieve the model for a bound value.
     *
     * @param  mixed  $value
     * @param  string|null  $field
     * @return \Illuminate\Database\Eloquent\Model|null
     */
    public function resolveRouteBinding($value, $field = null)
    {
        // If no field was given, use the primary key
        if ($field === null) {
            $field = $this->getRouteKeyName();
        }

        // Apply where clause
        $query = $this->where($field, $value);

        // Conditionally remove the softdelete scope to allow seeing soft-deleted records
            $query->withoutGlobalScope(SoftDeletingScope::class);

        // Find the first record, or abort
        return $query->firstOrFail();
    }
Last updated 1 year ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.