Optimize view paths for module views in theme folder (#1081)

* override \Igaster\LaravelTheme\themeViewFinder as a workaround until PR#133 in igaster/laravel-theme is merged

* fixup code style

* further code style fix

Co-authored-by: Andreas Palm <ap@ewsp.de>
This commit is contained in:
exciler
2021-03-19 14:22:03 +01:00
committed by GitHub
parent 7072428218
commit 2cede04b1e
2 changed files with 97 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Providers;
use App\Services\ModuleService;
use App\Support\ThemeViewFinder;
use App\Support\Utils;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Schema;
@@ -23,6 +24,14 @@ class AppServiceProvider extends ServiceProvider
*/
public function register(): void
{
$this->app->singleton('view.finder', function ($app) {
return new ThemeViewFinder(
$app['files'],
$app['config']['view.paths'],
null
);
});
// Only load the IDE helper if it's included and enabled
if (config('app.debug') === true) {
/* @noinspection NestedPositiveIfStatementsInspection */