Skip to content

Commit

Permalink
🩹 Do not return blade files
Browse files Browse the repository at this point in the history
🧑‍💻 Allow blade views to override FSE templates
  • Loading branch information
Log1x committed Mar 18, 2024
1 parent 95c5f0b commit 639155e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Roots/Acorn/Sage/Concerns/FiltersTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Roots\Acorn\Sage\Concerns;

use Illuminate\Support\Str;

trait FiltersTemplates
{
/**
Expand All @@ -14,7 +16,7 @@ trait FiltersTemplates
*/
public function filterTemplateHierarchy($files)
{
return $files + [$this->sageFinder->locate($files)];
return [...$this->sageFinder->locate($files), ...$files];
}

/**
Expand All @@ -27,8 +29,7 @@ public function filterTemplateHierarchy($files)
*/
public function filterTemplateInclude($file)
{

if (@file_exists($file)) {
if (@file_exists($file) && ! Str::endsWith($file, '.blade.php')) {
return $file;
}

Expand Down

0 comments on commit 639155e

Please sign in to comment.