Skip to content

Commit

Permalink
feat: add locale method to documentation model
Browse files Browse the repository at this point in the history
feat: add locale method to documentation model
  • Loading branch information
lukas-frey authored Sep 4, 2024
2 parents 7907d54 + 76ef5f6 commit 27dd15f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Models/FlatfileDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ class FlatfileDocumentation extends Model implements Documentable

public $incrementing = false;

public function getLocale(): string
{
return App::getLocale();
}

public function getRows()
{
$path = base_path(
str(config('filament-knowledge-base.docs-path'))
->append('/')
->append(App::getLocale())
->append($this->getLocale())
);

return collect(File::allFiles($path))
Expand Down

0 comments on commit 27dd15f

Please sign in to comment.