Skip to content

Commit e0a545a

Browse files
committed
Renames the turbo_channel and turbo_channel_auth helper functions
1 parent a7c8fda commit e0a545a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/TurboServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ private function bindBladeMacros(): void
5454
});
5555

5656
Blade::directive('domid', function ($expression) {
57-
return "<?php echo e(\Tonysm\TurboLaravel\dom_id($expression)); ?>";
57+
return "<?php echo e(\\Tonysm\\TurboLaravel\\dom_id($expression)); ?>";
5858
});
5959

6060
Blade::directive('domclass', function ($expression) {
61-
return "<?php echo e(\Tonysm\TurboLaravel\dom_class($expression)); ?>";
61+
return "<?php echo e(\\Tonysm\\TurboLaravel\\dom_class($expression)); ?>";
6262
});
6363

6464
Blade::directive('channel', function ($expression) {
65-
return "<?php echo e(\Tonysm\TurboLaravel\channel_name($expression)); ?>";
65+
return "<?php echo e(\\Tonysm\\TurboLaravel\\turbo_channel($expression)); ?>";
6666
});
6767
}
6868

src/helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function dom_class(Model $model, string $prefix = ""): string
3636
* @param Model $model
3737
* @return string
3838
*/
39-
function channel_name(Model $model): string
39+
function turbo_channel(Model $model): string
4040
{
41-
return (new RecordIdentifier($model))->channelName();
41+
return turbo_channel_auth(get_class($model), $model->getKey());
4242
}
4343

4444
/**
@@ -49,7 +49,7 @@ function channel_name(Model $model): string
4949
* @param string|null $wildcard
5050
* @return string
5151
*/
52-
function channel_auth(string $className, string $wildcard = null): string
52+
function turbo_channel_auth(string $className, string $wildcard = null): string
5353
{
5454
return RecordIdentifier::channelAuthKey($className, $wildcard ?: "{id}");
5555
}

0 commit comments

Comments
 (0)