Skip to content

Commit 570fd0b

Browse files
committed
feat: add helper functions
1 parent 98bcaaf commit 570fd0b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"phpstan/phpstan-phpunit": "^1.0"
3838
},
3939
"autoload": {
40+
"files": [
41+
"src/helpers.php"
42+
],
4043
"psr-4": {
4144
"RectitudeOpen\\FilamentSiteSnippets\\": "src/",
4245
"RectitudeOpen\\FilamentSiteSnippets\\Database\\Factories\\": "database/factories/"

src/helpers.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use RectitudeOpen\FilamentSiteSnippets\FilamentSiteSnippets;
6+
7+
if (! function_exists('snippet')) {
8+
function snippet(string $key, mixed $default = null)
9+
{
10+
return app(FilamentSiteSnippets::class)::get($key, $default);
11+
}
12+
}

0 commit comments

Comments
 (0)