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

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

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

Sign in to participate in this thread!


Your banner here too?


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 - All rights reserved.