protected function getModelByKey(Model $model, $key)
    {
        return $model::withoutGlobalScopes()
            ->where($model->getKeyName(), $key)
            ->first();
    }
protected function getModelByKey(Model $model, $key)
    {
        return $model::withoutGlobalScopes()
            ->where($model->getKeyName(), $key)
            ->first();
    }
protected function getModelByKey ( Model $ model , $ key ) { return $ model :: withoutGlobalScopes ( ) -> where ( $ model -> getKeyName ( ) , $ key ) -> first ( ) ; }
Returns model instance by key.

@param Model $model
@param mixed $key
@return Model|null
Returns model instance by key .