thedevdojo/voyager

[BUG] belongsToMany Relationship, Allow Tagging, and Custom URL Slugs

开放

#4,128 创建于 2019年5月9日

 (1 条评论) (4 个反应) (0 位负责人)PHP (2,652 个派生)batch import
help wantedtype:bug

仓库指标

星标
 (11,817 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Version information

  • Laravel: v5.7.28
  • Voyager: v1.2.3
  • PHP: 7.2
  • Database: MySQL 5.7.25

Description:

When a relationship has tagging enabled and the BREAD for the other table has a custom slug a route not defined error is thrown.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create belongsToMany relationships
  2. Create BREAD with custom "URL Slugs"
  3. Add relationship and Allow Tagging
  4. Go to the Add or Edit page of the BREAD with the relationship

Expected behavior

The add and edit page to load.

Additional context

vendor/tcg/voyager/resources/views/formfields/relationship.blade.php:159

When I looked at the relationship blade file the route is created off the table name when tagging is on. And the route for the relationship is a custom slug.

@if(isset($options->taggable) && $options->taggable == 'on')
    data-route="{{ route('voyager.'.\Illuminate\Support\Str::slug($options->table).'.store') }}"
    data-label="{{$options->label}}"
    data-error-message="{{__('voyager::bread.error_tagging')}}"
@endif

贡献者指南