Skip to content

Commit 9a486a0

Browse files
author
Neil Herbert
committed
Rename isLaravel57orUp() to expectsAssetsFolder() and provide more useful docblock comment
1 parent feb98a0 commit 9a486a0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/TablerPreset.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected static function updateBootstrapping()
6161
{
6262
copy(__DIR__.'/tabler-stubs/webpack.mix.js', base_path('webpack.mix.js'));
6363

64-
if (self::isLaravel57orUp()) {
64+
if (!self::expectsAssetsFolder()) {
6565
file_put_contents(base_path('webpack.mix.js'),
6666
str_replace(
6767
'assets/',
@@ -111,20 +111,20 @@ protected static function compileControllerStub()
111111
*/
112112
protected static function getResourcePath($path = '')
113113
{
114-
if (self::isLaravel57orUp()) {
115-
return resource_path($path);
114+
if (self::expectsAssetsFolder()) {
115+
return resource_path('assets/'.$path);
116116
}
117117

118-
return resource_path('assets/'.$path);
118+
return resource_path($path);
119119
}
120120

121121
/**
122-
* Is running in Laravel 5.7 or up?
122+
* Should we expect to see an assets folder within this version of Laravel?
123123
*
124124
* @return bool
125125
*/
126-
protected static function isLaravel57orUp()
126+
protected static function expectsAssetsFolder()
127127
{
128-
return (int) str_replace('.', '', app()->version()) >= 570;
128+
return (int) str_replace('.', '', app()->version()) < 570;
129129
}
130130
}

0 commit comments

Comments
 (0)