Skip to content

Commit

Permalink
Add primaryColumn to default relation manager
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Mar 6, 2021
1 parent c775a5b commit 688df55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/RelationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class RelationManager extends Component

public static function getPrimaryColumn()
{
return property_exists(static::class, 'primaryColumn') ?
return property_exists(static::class, 'primaryColumn') && static::$primaryColumn !== '' ?
static::$primaryColumn :
null;
}
Expand Down
2 changes: 2 additions & 0 deletions stubs/RelationManager.stub
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use Filament\Resources\Tables\Table;

class {{ managerClass }} extends RelationManager
{
public static $primaryColumn = '';

public static $relationship = '{{ relationship }}';

public static function form(Form $form)
Expand Down

0 comments on commit 688df55

Please sign in to comment.