-
-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.0-dev' into project-checklist-ui-fix-2171
- Loading branch information
Showing
99 changed files
with
14,392 additions
and
9,269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Core\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use Illuminate\Support\Facades\Blade; | ||
use Leantime\Core\Support\AssetHelper; | ||
|
||
class ViewServiceProvider extends ServiceProvider | ||
{ | ||
public function boot() | ||
{ | ||
Blade::directive('mix', function ($expression) { | ||
return "<?php echo \Leantime\Core\Support\AssetHelper::mix($expression); ?>"; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Leantime\Core\Support; | ||
|
||
use Illuminate\Support\Facades\File; | ||
|
||
class AssetHelper | ||
{ | ||
protected static $manifestPath = '/public/dist/mix-manifest.json'; | ||
protected static $manifest = null; | ||
|
||
public static function mix($path) | ||
{ | ||
if (static::$manifest === null) { | ||
if (File::exists(base_path().static::$manifestPath)) { | ||
static::$manifest = json_decode(File::get(base_path().static::$manifestPath), true); | ||
} else { | ||
static::$manifest = []; | ||
} | ||
} | ||
|
||
if (!str_starts_with($path, '/')) { | ||
$path = "/{$path}"; | ||
} | ||
|
||
if (isset(static::$manifest[$path])) { | ||
return '/dist/' . ltrim(static::$manifest[$path], '/'); | ||
} | ||
|
||
return '/dist/' . ltrim($path, '/'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.