Skip to content

Commit 82c7600

Browse files
committed
Add an alias method for asset retrieval to the facade
1 parent b26bb18 commit 82c7600

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/framework/src/Facades/Asset.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
*/
1919
class Asset
2020
{
21+
public static function get(string $file): string
22+
{
23+
return Hyde::asset($file);
24+
}
25+
2126
public static function mediaLink(string $file): string
2227
{
2328
return Hyde::mediaLink($file).static::getCacheBustKey($file);

packages/framework/tests/Unit/Facades/AssetFacadeUnitTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ protected function tearDown(): void
3131
$this->cleanUpFilesystem();
3232
}
3333

34+
public function testGetHelper()
35+
{
36+
$this->assertSame(Hyde::asset('foo'), Asset::get('foo'));
37+
}
38+
3439
public function testHasMediaFileHelper()
3540
{
3641
$this->assertFalse(Asset::hasMediaFile('styles.css'));

0 commit comments

Comments
 (0)