Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
abordage committed Jul 6, 2022
1 parent c55d730 commit 7ca2841
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,6 @@ class MyTableCard extends TableCard

return $rows;
}

/**
* @param Model $model
* @return string
*/
private function getResourceUrl(Model $model): string
{
return config('nova.path') . '/resources/' . str_replace('_', '-', $model->getTable()) . '/' . $model->getKey();
}
}
```

Expand Down
9 changes: 0 additions & 9 deletions src/Console/Card.stub
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,4 @@ class {{ class }} extends TableCard

return $rows;
}

/**
* @param Model $model
* @return string
*/
private function getResourceUrl(Model $model): string
{
return config('nova.path') . '/resources/' . str_replace('_', '-', $model->getTable()) . '/' . $model->getKey();
}
}
11 changes: 11 additions & 0 deletions src/TableCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Abordage\TableCard;

use Illuminate\Database\Eloquent\Model;
use Laravel\Nova\Card;

class TableCard extends Card
Expand All @@ -27,6 +28,16 @@ public function rows(): array
return [];
}

/**
* @param Model $model
* @return string
* @phpstan-ignore-next-line
*/
private function getResourceUrl(Model $model): string
{
return config('nova.path') . '/resources/' . str_replace('_', '-', $model->getTable()) . '/' . $model->getKey();
}

public function jsonSerialize(): array
{
return array_merge([
Expand Down

0 comments on commit 7ca2841

Please sign in to comment.