Fix issue with SKIN_NAME being undefined
This commit is contained in:
@@ -1,26 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Repositories\SettingRepository;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use View;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot()
|
||||
public function boot(): void
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
$this->app->bind('setting', SettingRepository::class);
|
||||
|
||||
View::share('SKIN_NAME', config('phpvms.skin'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register()
|
||||
public function register(): void
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -93,11 +93,12 @@ if (!function_exists('skin_view')) {
|
||||
{
|
||||
# Add the current skin name so we don't need to hardcode it in the templates
|
||||
# Makes it a bit easier to create a new skin by modifying an existing one
|
||||
$merge_data['SKIN_NAME'] = config('phpvms.skin');
|
||||
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
|
||||
if(View::exists($template)) {
|
||||
return view($template, $vars, $merge_data);
|
||||
}
|
||||
|
||||
# TODO: Look for an overridden template in a special folder
|
||||
|
||||
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
|
||||
return view($tpl, $vars, $merge_data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user